mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-02 02:12:25 +00:00
fix: insert the whole emoji when its shortcode is a codepoint sequence (#30213)
This commit is contained in:
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, {
|
||||
|
|
|
|||
|
|
@ -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, {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue