forked from rDrama/rDrama
fix emoji tags
parent
3b7eeffba5
commit
47a0122362
|
@ -231,7 +231,7 @@ def sanitize(sanitized, noimages=False):
|
|||
for i in re.finditer(':([^ ]{1,30}?):', sanitized):
|
||||
emoji = i.group(1).lower()
|
||||
if path.isfile(f'./files/assets/images/emojis/{emoji}.webp'):
|
||||
sanitized = sanitized.replace(f':{emoji}:', f'<img loading="lazy" data-toggle="tooltip" title="{emoji}" delay="0" height=30 src="https://{site}/assets/images/emojis/{emoji}.webp"<span>')
|
||||
sanitized = sanitized.replace(f':{emoji}:', f'<img loading="lazy" data-toggle="tooltip" title="{emoji}" delay="0" height=30 src="https://{site}/assets/images/emojis/{emoji}.webp">')
|
||||
|
||||
try:
|
||||
if emoji in session["favorite_emojis"]: session["favorite_emojis"][emoji] += 1
|
||||
|
|
|
@ -439,7 +439,7 @@ def filter_title(title):
|
|||
|
||||
for i in re.finditer(':(.{1,30}?):', title):
|
||||
if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'):
|
||||
title = title.replace(f':{i.group(1)}:', f'<img loading="lazy" data-toggle="tooltip" title="{i.group(1)}" delay="0" height=20 src="https://{site}/assets/images/emojis/{i.group(1)}.webp"<span>')
|
||||
title = title.replace(f':{i.group(1)}:', f'<img loading="lazy" data-toggle="tooltip" title="{i.group(1)}" delay="0" height=20 src="https://{site}/assets/images/emojis/{i.group(1)}.webp">')
|
||||
|
||||
return title
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ def api_flag_post(pid, v):
|
|||
|
||||
for i in re.finditer(':(.{1,30}?):', reason):
|
||||
if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'):
|
||||
reason = reason.replace(f':{i.group(1)}:', f'<img loading="lazy" data-toggle="tooltip" title="{i.group(1)}" delay="0" height=20 src="https://{site}/assets/images/emojis/{i.group(1)}.webp"<span>')
|
||||
reason = reason.replace(f':{i.group(1)}:', f'<img loading="lazy" data-toggle="tooltip" title="{i.group(1)}" delay="0" height=20 src="https://{site}/assets/images/emojis/{i.group(1)}.webp">')
|
||||
|
||||
flag = Flag(post_id=post.id,
|
||||
user_id=v.id,
|
||||
|
@ -52,7 +52,7 @@ def api_flag_comment(cid, v):
|
|||
|
||||
for i in re.finditer(':(.{1,30}?):', reason):
|
||||
if path.isfile(f'./files/assets/images/emojis/{i.group(1)}.webp'):
|
||||
reason = reason.replace(f':{i.group(1)}:', f'<img loading="lazy" data-toggle="tooltip" title="{i.group(1)}" delay="0" height=20 src="https://{site}/assets/images/emojis/{i.group(1)}.webp"<span>')
|
||||
reason = reason.replace(f':{i.group(1)}:', f'<img loading="lazy" data-toggle="tooltip" title="{i.group(1)}" delay="0" height=20 src="https://{site}/assets/images/emojis/{i.group(1)}.webp">')
|
||||
|
||||
flag = CommentFlag(comment_id=comment.id,
|
||||
user_id=v.id,
|
||||
|
|
Loading…
Reference in New Issue