forked from rDrama/rDrama
dfsfds
parent
afe8ab131f
commit
55522eba6a
|
@ -215,6 +215,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
|
|
||||||
for i in re.finditer("^\s*((:\w+:)\s*)+$", sanitized.replace("<p>", "").replace("</p>", ""), re.MULTILINE):
|
for i in re.finditer("^\s*((:\w+:)\s*)+$", sanitized.replace("<p>", "").replace("</p>", ""), re.MULTILINE):
|
||||||
emojis = i.group(0).lower()
|
emojis = i.group(0).lower()
|
||||||
|
print(emojis)
|
||||||
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', emojis):
|
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', emojis):
|
||||||
emoji = i.group(1).lower()
|
emoji = i.group(1).lower()
|
||||||
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
||||||
|
@ -226,9 +227,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
old = "<p>" + i.group(0).lower() + "</p>"
|
old = "<p>" + i.group(0).lower() + "</p>"
|
||||||
print(old)
|
|
||||||
new = '<p style="margin-bottom:0 !important">' + emojis + "</p>"
|
new = '<p style="margin-bottom:0 !important">' + emojis + "</p>"
|
||||||
print(new)
|
|
||||||
sanitized = sanitized.replace(old, new)
|
sanitized = sanitized.replace(old, new)
|
||||||
|
|
||||||
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', sanitized):
|
for i in re.finditer('\w*(?<!"):([^ ]{1,30}?):', sanitized):
|
||||||
|
|
Loading…
Reference in New Issue