From ecc672cccc90dfb3f1dca95d8ee0f80d2ce1bc01 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 5 Jul 2019 08:40:00 +0100 Subject: [PATCH] add comment Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/HtmlUtils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/HtmlUtils.js b/src/HtmlUtils.js index 16c84deedd..73ab28e65c 100644 --- a/src/HtmlUtils.js +++ b/src/HtmlUtils.js @@ -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]}:` : '');