remotes/1693045480750635534/spooky-22
Aevann1 2021-09-23 00:02:28 +02:00
parent 48e809640d
commit 23a9f47287
1 changed files with 3 additions and 3 deletions

View File

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