forked from rDrama/rDrama
fdfddf
parent
695c4876cc
commit
6a78d3cfd9
|
@ -178,11 +178,9 @@ def sanitize(text, linkgen=False, flair=False):
|
||||||
end = '</s>'
|
end = '</s>'
|
||||||
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>')
|
||||||
|
|
||||||
print(sanitized)
|
|
||||||
|
|
||||||
for i in re.finditer('<p>:(.{1,30}?):</p>', sanitized):
|
for i in re.finditer('<p>:(.{1,30}?):</p>', sanitized):
|
||||||
if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'):
|
if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.gif'):
|
||||||
sanitized = sanitized.replace(f':{i.group(1)}:', f'<img data-toggle="tooltip" title="{i.group(1)}" delay="0" height=60 src="https://{site}/assets/images/emojis/{i.group(1)}.gif"<span>')
|
sanitized = sanitized.replace(f'<p>:{i.group(1)}:</p>', f'<img data-toggle="tooltip" title="{i.group(1)}" delay="0" height=60 src="https://{site}/assets/images/emojis/{i.group(1)}.gif"<span>')
|
||||||
|
|
||||||
if flair: emojisize = 20
|
if flair: emojisize = 20
|
||||||
else: emojisize = 30
|
else: emojisize = 30
|
||||||
|
|
Loading…
Reference in New Issue