forked from rDrama/rDrama
dfsfds
parent
0864eed0a6
commit
92dc243b14
|
@ -214,8 +214,8 @@ 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>\s*((:\w+:)\s*)+<\/p>", sanitized):
|
for i in re.finditer("<p>\s*((:\w+:)\s*)+<\/p>", sanitized):
|
||||||
emojis = i.group(0).lower()
|
old = i.group(0)
|
||||||
print(emojis)
|
emojis = i.group(0).lower().replace("<p>", "<p style='margin-bottom:0 !important'>")
|
||||||
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'):
|
||||||
|
@ -224,9 +224,7 @@ def sanitize(sanitized, noimages=False):
|
||||||
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
|
||||||
|
|
||||||
old = "<p>" + i.group(0) + "</p>"
|
sanitized = sanitized.replace(old, emojis)
|
||||||
new = "<p style='margin-bottom:0 !important'>" + emojis + "</p>"
|
|
||||||
sanitized = sanitized.replace(old, new)
|
|
||||||
|
|
||||||
# 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