From 47978226e1078751c236110f677b8ac380b4f694 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 27 Apr 2022 17:15:41 +0200 Subject: [PATCH] df --- files/helpers/sanitize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 989b6d809..c85271979 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -108,7 +108,9 @@ def render_emoji(html, regexp, edit, marseys_used=set(), b=False): emoji_partial = ':{0}:' emoji_html = None - if emoji.endswith('pat'): + if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): + emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs) + elif emoji.endswith('pat'): if path.isfile(f"files/assets/images/emojis/{emoji.replace('pat','')}.webp"): attrs += ' pat' emoji_html = f'{emoji_partial.format(old, f"/e/{emoji[:-3]}.webp", attrs)}' @@ -116,8 +118,6 @@ def render_emoji(html, regexp, edit, marseys_used=set(), b=False): if u := get_user(emoji[1:-3], graceful=True): attrs += ' pat' emoji_html = f'{emoji_partial.format(old, f"/pp/{u.id}", attrs)}' - elif path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - emoji_html = emoji_partial.format(old, f'/e/{emoji}.webp', attrs) if emoji_html: