fix: insert the whole emoji when its shortcode is a codepoint sequence (#30213)

This commit is contained in:
G30
2026-09-21 08:07:45 -04:00
committed by GitHub
parent 9012bd153d
commit aa65f55692
2 changed files with 8 additions and 2 deletions
@@ -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, {
+4 -1
View File
@@ -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, {