From 21829bbe5e19bca0310343c8ba3a0fe20c8287cb Mon Sep 17 00:00:00 2001
From: Aryan Jassal <84617406+aryanjassal@users.noreply.github.com>
Date: Fri, 20 Nov 2026 17:21:19 +1100
Subject: [PATCH] fix: emojis showing title instead of popup shortcode (#2732)
* Emojis now show popup shortcode
* Custom emojis also show popup shortcode
---
src/app/plugins/react-custom-html-parser.tsx | 71 +++++++++++++++-----
1 file changed, 54 insertions(+), 17 deletions(-)
diff --git a/src/app/plugins/react-custom-html-parser.tsx b/src/app/plugins/react-custom-html-parser.tsx
index d55d9ca1a..95e79d863 100644
--- a/src/app/plugins/react-custom-html-parser.tsx
+++ b/src/app/plugins/react-custom-html-parser.tsx
@@ -207,13 +207,28 @@ export const scaleSystemEmoji = (text: string): (string | JSX.Element)[] =>
findAndReplace(
text,
EMOJI_REG_G,
- (match, pushIndex) => (
-
-
- {match[0]}
-
-
- ),
+ (match, pushIndex) => {
+ const shortcode = getShortcodeFor(getHexcodeForEmoji(match[0])) ?? 'unknown';
+ return (
+
+ :{shortcode}:
+
+ }
+ >
+ {(targetRef) => (
+
+
+ {match[0]}
+
+
+ )}
+
+ );
+ },
(txt) => txt
);
@@ -553,11 +568,22 @@ export const getReactCustomHtmlParser = (
const htmlSrc = mxcToHttp(ct.session.baseUrl, props.src, params.useAuthentication).url();
if (htmlSrc && 'data-mx-emoticon' in props) {
return (
-
-
-
-
-
+
+ :{props.title || props.alt || 'unknown'}:
+
+ }
+ >
+ {(targetRef) => (
+
+
+
+
+
+ )}
+
);
}
if (htmlSrc) return
;
@@ -703,11 +729,22 @@ export const getReactCustomHtmlInlineParser = (
const htmlSrc = mxcToHttp(ct.session.baseUrl, props.src, params.useAuthentication).url();
if (htmlSrc && 'data-mx-emoticon' in props) {
return (
-
-
-
-
-
+
+ :{props.title || props.alt || 'unknown'}:
+
+ }
+ >
+ {(targetRef) => (
+
+
+
+
+
+ )}
+
);
}
if (htmlSrc) return Click to see image;