forked from rDrama/rDrama
dfsfsdfddgf
parent
5d645e2966
commit
05017cd917
|
@ -212,9 +212,11 @@ def sanitize(sanitized, noimages=False):
|
||||||
|
|
||||||
for i in re.finditer("<p>\s*((!\w+!)\s*)+<\/p>", sanitized):
|
for i in re.finditer("<p>\s*((!\w+!)\s*)+<\/p>", sanitized):
|
||||||
old = i.group(0)
|
old = i.group(0)
|
||||||
|
print(old)
|
||||||
new = old.lower().replace("<p>", "<p style='margin-bottom:0 !important'>")
|
new = old.lower().replace("<p>", "<p style='margin-bottom:0 !important'>")
|
||||||
for i in re.finditer('\w*(?<!")!([^ ]{1,30}?)!', new):
|
for i in re.finditer('\w*(?<!")!([^ ]{1,30}?)!', new):
|
||||||
emoji = i.group(1).lower()
|
emoji = i.group(1).lower()
|
||||||
|
print(emoji)
|
||||||
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
||||||
new = 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" style="transform: scaleX(-1)">', new)
|
new = 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" style="transform: scaleX(-1)">', new)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue