forked from MarseyWorld/MarseyWorld
fdgd
parent
f878557b77
commit
4a5b54ff76
|
@ -219,11 +219,10 @@ def sanitize(sanitized, noimages=False):
|
|||
|
||||
for i in re.finditer("^(\s+)?((:[\w]+:)+(\s+)?)+", sanitized.replace("<p>", "").replace("</p>", ""), re.MULTILINE):
|
||||
emojis = i.group(0).lower()
|
||||
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', emojis):
|
||||
emoji = i.group(1)
|
||||
print(emoji)
|
||||
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-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=60 src="https://{site}/assets/images/emojis/{emoji}.webp">')
|
||||
sanitized = 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">', sanitized)
|
||||
|
||||
try:
|
||||
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
||||
|
|
Loading…
Reference in New Issue