diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 97696468e..c795b559b 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5517,8 +5517,7 @@ input[type=radio] ~ .custom-control-label::before { height: 150px; width: 150px; } -.emj, .emoji, .bigemoji, .emoji-md, .emoji-lg, img[alt^=":"] -{ +.emj, .emoji, .bigemoji, .emoji-md, .emoji-lg, img[alt^=":"] { max-width: 150px !important; max-height: 150px !important; max-width: min(150px,25vw) !important; @@ -5526,6 +5525,9 @@ input[type=radio] ~ .custom-control-label::before { display: inline-block; object-fit: contain; } +.emoji, .emoji-lg, img[data-kind=Classic] { + image-rendering: pixelated; +} span[data-bs-toggle], .pat-preview { position: relative; diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index d418b846c..044ecea55 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -83,6 +83,7 @@ def allowed_attributes(tag, name, value): if name in {'alt','title'}: return True if name == 'class' and value == 'img': return True if name == 'data-user-submitted' and not value: return True + if name == 'data-kind' and value in EMOJI_KINDS: return True if tag == 'lite-youtube': if name == 'params' and value.startswith('autoplay=1&modestbranding=1'): return True @@ -338,6 +339,10 @@ def old_render_emoji(html, regexp, golden, emojis_used, b=False, is_title=False) if(is_loved): modifier_html = f'{modifier_html}{loved_html}' + kind = g.db.query(Emoji.kind).filter(Emoji.name==emoji).one_or_none() + if kind: + attrs += ' data-kind="' + kind[0].replace('"', '') + '"' + if (is_patted and emoji != 'marseyunpettable') or is_talking or is_genocided or is_loved: if path.isfile(f"files/assets/images/emojis/{emoji}.webp"): emoji_html = f'{modifier_html}{emoji_partial_pat.format(old, f"{SITE_FULL_IMAGES}/e/{emoji}.webp", attrs)}'