master
Aevann1 2021-10-01 01:58:22 +02:00
parent 3a910f6b7e
commit 24a9b655d5
1 changed files with 3 additions and 6 deletions

View File

@ -220,12 +220,9 @@ def sanitize(sanitized, noimages=False):
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
emojis = re.sub(f'\w*(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=60 src="https://{site}/assets/images/emojis/{emoji}.webp">', emojis)
try:
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
else: session["favorite_emojis"][emoji] = 1
except:
pass
emojis = emojis.replace('<p>', '<p style="margin-bottom:0 !important>')
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
else: session["favorite_emojis"][emoji] = 1
emojis = emojis.replace('<p>', '<p style="margin-bottom:0 !important">')
sanitized = sanitized.replace(i.group(1), emojis)
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', sanitized):