fix(frontend/emoji) restore U+FE0F for simple emojis (#12866)

* fix(frontend/emoji) restore U+FE0F for simple emojis

* Update CHANGELOG.md

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
This commit is contained in:
Kagami Sascha Rosylight
2024-01-07 08:02:53 +01:00
committed by GitHub
parent c6a4caa8be
commit 5e71418d5c
5 changed files with 65 additions and 18 deletions

View File

@@ -36,7 +36,8 @@ for (let i = 0; i < emojilist.length; i++) {
export const emojiCharByCategory = _charGroupByCategory;
export function getEmojiName(char: string): string | null {
const idx = _indexByChar.get(char);
// Colorize it because emojilist.json assumes that
const idx = _indexByChar.get(colorizeEmoji(char));
if (idx == null) {
return null;
} else {
@@ -44,6 +45,10 @@ export function getEmojiName(char: string): string | null {
}
}
export function colorizeEmoji(char: string) {
return char.length === 1 ? `${char}\uFE0F` : char;
}
export interface CustomEmojiFolderTree {
value: string;
category: string;