master
Aevann1 2021-10-01 02:21:33 +02:00
parent 05f4899593
commit 0864eed0a6
1 changed files with 2 additions and 1 deletions

View File

@ -215,6 +215,7 @@ def sanitize(sanitized, noimages=False):
for i in re.finditer("<p>\s*((:\w+:)\s*)+<\/p>", sanitized):
emojis = i.group(0).lower()
print(emojis)
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', emojis):
emoji = i.group(1).lower()
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
@ -222,7 +223,7 @@ def sanitize(sanitized, noimages=False):
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
else: session["favorite_emojis"][emoji] = 1
print(emojis)
old = "<p>" + i.group(0) + "</p>"
new = "<p style='margin-bottom:0 !important'>" + emojis + "</p>"
sanitized = sanitized.replace(old, new)