From 543c3bcc252ba672c4ed6d7c0b92b3595998f100 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 10 Oct 2024 21:36:54 +0300 Subject: [PATCH] web/timeline: add vertical align for custom emojis --- web/src/ui/timeline/TimelineEvent.css | 4 ++++ web/src/util/html.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/web/src/ui/timeline/TimelineEvent.css b/web/src/ui/timeline/TimelineEvent.css index 3ba9e50..fe63983 100644 --- a/web/src/ui/timeline/TimelineEvent.css +++ b/web/src/ui/timeline/TimelineEvent.css @@ -10,3 +10,7 @@ div.media-container { max-height: 100%; } } + +img[data-mx-emoticon] { + vertical-align: middle; +} diff --git a/web/src/util/html.ts b/web/src/util/html.ts index 6859446..77adabd 100644 --- a/web/src/util/html.ts +++ b/web/src/util/html.ts @@ -188,7 +188,7 @@ export const sanitizeHtmlParams: sanitizeHtml.IOptions = { // eslint-disable-next-line id-length a: ["href", "name", "target", "rel"], // remote target: custom to matrix // img tags also accept width/height, we just map those to max-width & max-height during transformation - img: ["src", "alt", "title", "style"], + img: ["src", "alt", "title", "style", "data-mx-emoticon"], ol: ["start"], code: ["class"], // We don't actually allow all classes, we filter them in transformTags },