From 24564dfd594cad73611be56cc03171da448ceee9 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 12 Jan 2026 10:26:55 +0000 Subject: [PATCH] fix: serialize unicode emoji as actual characters, not shortcodes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When sending messages: - Unicode emoji (:smile:, :fire:) → outputs 😄, 🔥 (the actual character) - Custom emoji (:pepe:) → outputs :pepe: with emoji tag for rendering --- src/components/editor/MentionEditor.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/editor/MentionEditor.tsx b/src/components/editor/MentionEditor.tsx index a42695f..6cbe7a9 100644 --- a/src/components/editor/MentionEditor.tsx +++ b/src/components/editor/MentionEditor.tsx @@ -335,15 +335,14 @@ export const MentionEditor = forwardRef< const url = child.attrs?.url; const source = child.attrs?.source; - if (shortcode) { + if (source === "unicode" && url) { + // Unicode emoji - output the actual character + text += url; + } else if (shortcode) { + // Custom emoji - output :shortcode: and add tag text += `:${shortcode}:`; - // Only add emoji tag for custom emojis (not unicode) - if ( - url && - source !== "unicode" && - !seenEmojis.has(shortcode) - ) { + if (url && !seenEmojis.has(shortcode)) { seenEmojis.add(shortcode); emojiTags.push({ shortcode, url }); }