Repository navigation
fix(builder): keep U+FE0F in flow editor emoji - #1698
Merged
realcodesiman merged 2 commits intoNov 11, 2026
Merged
Conversation
emojiToShortcode in @tiptap/extension-emoji 3.26.0 strips one variation selector and compares it with item.emoji. Qualifying the catalogue character made both heart forms miss, so they stayed plain text. Lookup keeps the catalogue character. renderText and renderHTML emit the fully-qualified form.
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
* fix(builder): keep U+FE0F in flow editor emoji * fix(builder): qualify emoji text without breaking lookup emojiToShortcode in @tiptap/extension-emoji 3.26.0 strips one variation selector and compares it with item.emoji. Qualifying the catalogue character made both heart forms miss, so they stayed plain text. Lookup keeps the catalogue character. renderText and renderHTML emit the fully-qualified form. --------- Co-authored-by: Mark David Prado <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1686
What changed
Both flow builder TipTap editors (
tiptap-editor.tsxandplain-text-tiptap-editor.tsx) now use one shared emoji extension fromapps/builder/src/components/tiptap/fully-qualified-github-emojis.ts. It isEmoji.extend()with the stockgitHubEmojiscatalogue, and onlyrenderTextandrenderHTMLare overridden to emit the fully-qualified character (with U+FE0F). That character is read from the emoji's Apple fallback image name, for example0031-fe0f-20e3.pngfor 1️⃣.Why
gitHubEmojisstores keycaps, hearts, warnings and arrows without the variation selector (1⃣,❤,⚠,➡). The extension'srenderTextreturns that catalogue character, sogetText(), which the flow editors save, dropped U+FE0F. A message typed as1️⃣ ❤️ ⚠️was saved as1⃣ ❤ ⚠.The catalogue itself is left unqualified on purpose.
emojiToShortcodestrips the variation selector from the input and compares the result toitem.emoji, so qualifying the catalogue would stop both❤and❤️from becoming emoji nodes. Lookup, suggestions, emoticons and fallback images therefore behave exactly as before; only the text and HTML output change. Names and shortcodes resolve to the first catalogue row that owns them, the same rule asshortcodeToEmoji, sosunglassesstays 😎 even though a later row also uses that shortcode. Emoji that are fully qualified without U+FE0F (😀, 👍) are untouched, and ZWJ sequences such as ❤️🔥 keep their other code points. The emitted spans keepdata-type="emoji"anddata-name, so saved content and pasted HTML still parse.Screenshots
Isolated TipTap editor with the flow editor emoji setup: 1️⃣ ❤️⚠️ ➡️ loaded, then read back with
getText(). The code-point line shows the difference.Before (

0031 20e3 0020 2764 0020 26a0 0020 27a1):After (

0031 fe0f 20e3 0020 2764 fe0f 0020 26a0 fe0f 0020 27a1 fe0f):Validation
apps/builder/__tests__/flow-editor-emoji-fe0f.test.ts(21 tests, with a small canvas shim in__tests__/helpers/emoji-canvas-shim.tsfor emoji support detection in jsdom). It checks for emoji nodes and names after loading, typing and pasting both the qualified and unqualified forms of 1️⃣ ❤️getText(). It also covers the typed shortcodes:one::red_heart::warning::arrow_right:, the emoticons<3and:(, the real suggestionitemsfunction,setEmojiserialization, and emoji that must not gain U+FE0F.gitHubEmojis, 19 of the 21 fail (U+FE0F is dropped on save). All 21 pass with this change.pnpm lint: passescheck-types: passes