forked from rDrama/rDrama
sfdsfd
parent
c469ff387b
commit
01559a954c
|
@ -217,8 +217,10 @@ 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>')
|
||||
|
||||
for i in re.finditer('<p>:([^ ]{1,30}?):</p>', sanitized):
|
||||
emoji = i.group(1).lower()
|
||||
for i in re.finditer('^(\s+)?((:[\w]+:)+(\s+)?)+$', sanitized):
|
||||
emojis = i.group(0).lower()
|
||||
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', emojis):
|
||||
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>')
|
||||
|
||||
|
|
Loading…
Reference in New Issue