diff options
| author | Kagami Sascha Rosylight <saschanaz@outlook.com> | 2024-01-07 08:02:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-07 16:02:53 +0900 |
| commit | 5e71418d5caca1cea333ee1b8629987cc69c4fbc (patch) | |
| tree | ac591fa298bbe9ed5e5a2dcf311df3eec922e0a2 /packages/frontend/src/scripts | |
| parent | refactor (diff) | |
| download | sharkey-5e71418d5caca1cea333ee1b8629987cc69c4fbc.tar.gz sharkey-5e71418d5caca1cea333ee1b8629987cc69c4fbc.tar.bz2 sharkey-5e71418d5caca1cea333ee1b8629987cc69c4fbc.zip | |
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>
Diffstat (limited to 'packages/frontend/src/scripts')
| -rw-r--r-- | packages/frontend/src/scripts/emojilist.ts | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/packages/frontend/src/scripts/emojilist.ts b/packages/frontend/src/scripts/emojilist.ts index 8885bf4b7f..4bd8bf94be 100644 --- a/packages/frontend/src/scripts/emojilist.ts +++ b/packages/frontend/src/scripts/emojilist.ts @@ -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; |