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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -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, {

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, {