forked from rDrama/rDrama
sfdsfd
parent
c469ff387b
commit
01559a954c
|
@ -217,16 +217,18 @@ def sanitize(sanitized, noimages=False):
|
||||||
|
|
||||||
if start in sanitized and end in sanitized and start in sanitized.split(end)[0] and end in sanitized.split(start)[1]: sanitized = sanitized.replace(start, '<span class="spoiler">').replace(end, '</span>')
|
if start in sanitized and end in sanitized and start in sanitized.split(end)[0] and end in sanitized.split(start)[1]: sanitized = sanitized.replace(start, '<span class="spoiler">').replace(end, '</span>')
|
||||||
|
|
||||||
for i in re.finditer('<p>:([^ ]{1,30}?):</p>', sanitized):
|
for i in re.finditer('^(\s+)?((:[\w]+:)+(\s+)?)+$', sanitized):
|
||||||
emoji = i.group(1).lower()
|
emojis = i.group(0).lower()
|
||||||
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', emojis):
|
||||||
sanitized = sanitized.replace(f'<p>:{emoji}:</p>', f'<p style="margin-bottom:0;"><img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=60 src="https://{site}/assets/images/emojis/{emoji}.webp"></p>')
|
emoji = i.group(1)
|
||||||
|
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-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" delay="0" height=60 src="https://{site}/assets/images/emojis/{emoji}.webp"></p>')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
||||||
else: session["favorite_emojis"][emoji] = 1
|
else: session["favorite_emojis"][emoji] = 1
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', sanitized):
|
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', sanitized):
|
||||||
emoji = i.group(1).lower()
|
emoji = i.group(1).lower()
|
||||||
|
|
Loading…
Reference in New Issue