mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-26 17:30:27 -04:00
fix: insert the whole emoji when its shortcode is a codepoint sequence (#30213)
This commit is contained in:
@@ -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, {
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user