mirror of
https://github.com/vector-im/element-web.git
synced 2026-02-13 11:41:44 +01:00
add comment
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
d0c8e09532
commit
ecc672cccc
@ -86,6 +86,8 @@ export function isSingleEmoji(str) {
|
||||
* @return {String} The shortcode (such as :thumbup:)
|
||||
*/
|
||||
export function unicodeToShortcode(char) {
|
||||
// Check against both the char and the char with an empty variation selector appended because that's how
|
||||
// emoji-base stores its base emojis which have variations. https://github.com/vector-im/riot-web/issues/9785
|
||||
const emptyVariation = char + VARIATION_SELECTOR;
|
||||
const data = EMOJIBASE.find(e => e.unicode === char || e.unicode === emptyVariation);
|
||||
return (data && data.shortcodes ? `:${data.shortcodes[0]}:` : '');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user