master
Aevann1 2021-08-02 16:47:56 +02:00
parent 9e9f9453d9
commit 550d0ab912
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ from functools import partial
from .get import *
from os import path
domain = environ.get("domain").strip()
site = environ.get("domain").strip()
_allowed_tags = tags = ['b',
'blockquote',
@ -184,7 +184,7 @@ def sanitize(text, linkgen=False, flair=False):
else: emojisize = 30
for i in re.finditer(':(.{1,30}?):', sanitized):
if path.isfile(f'./drama/assets/images/emojis/{i.group(1)}.gif'):
sanitized = sanitized.replace(f':{i.group(1)}:', f'<img data-toggle="tooltip" title="{i.group(1)}" delay="0" height={emojisize} src="https://{domain}/assets/images/emojis/{i.group(1)}.gif"<span>')
sanitized = sanitized.replace(f':{i.group(1)}:', f'<img data-toggle="tooltip" title="{i.group(1)}" delay="0" height={emojisize} src="https://{site}/assets/images/emojis/{i.group(1)}.gif"<span>')
sanitized = sanitized.replace("https://www.", "https://").replace("https://youtu.be/", "https://youtube.com/embed/").replace("https://music.youtube.com/watch?v=", "https://youtube.com/embed/").replace("/watch?v=", "/embed/").replace("https://open.spotify.com/", "https://open.spotify.com/embed/").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/embed/")