From aa65f55692cbc86639236598e9c2164e70e6f705 Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Mon, 21 Sep 2026 08:07:45 -0400 Subject: [PATCH] fix: insert the whole emoji when its shortcode is a codepoint sequence (#30213) --- src/lib/components/channel/MessageInput.svelte | 5 ++++- src/lib/components/chat/MessageInput.svelte | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/components/channel/MessageInput.svelte b/src/lib/components/channel/MessageInput.svelte index 8b84bb56dd..27976e0af5 100644 --- a/src/lib/components/channel/MessageInput.svelte +++ b/src/lib/components/channel/MessageInput.svelte @@ -630,7 +630,10 @@ command: ({ editor, range, props }) => { // Convert the Unicode hex codepoint (e.g. "1F44B") to the actual emoji character (👋) const codepoint = props.id; - const emoji = String.fromCodePoint(parseInt(codepoint, 16)); + const emoji = codepoint + .split('-') + .map((cp) => String.fromCodePoint(parseInt(cp, 16))) + .join(''); editor.chain().focus().deleteRange(range).insertContent(emoji).run(); }, render: getSuggestionRenderer(CommandSuggestionList, { diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index b1129a7564..e6b746e3d3 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -1568,7 +1568,10 @@ command: ({ editor, range, props }) => { // Convert the Unicode hex codepoint (e.g. "1F44B") to the actual emoji character (👋) const codepoint = props.id; - const emoji = String.fromCodePoint(parseInt(codepoint, 16)); + const emoji = codepoint + .split('-') + .map((cp) => String.fromCodePoint(parseInt(cp, 16))) + .join(''); editor.chain().focus().deleteRange(range).insertContent(emoji).run(); }, render: getSuggestionRenderer(CommandSuggestionList, {