From 8266286e99240058df7d2c5d727c362e990c4164 Mon Sep 17 00:00:00 2001 From: Stefan Parviainen Date: Wed, 11 Oct 2017 08:39:46 +0200 Subject: [PATCH] Ignore VS16 char in RTE Signed-off-by: Stefan Parviainen --- src/RichText.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/RichText.js b/src/RichText.js index cbd3b9ae18..dca14813f2 100644 --- a/src/RichText.js +++ b/src/RichText.js @@ -67,8 +67,14 @@ function unicodeToEmojiUri(str) { // if the unicodeChar doesnt exist just return the entire match return unicodeChar; } else { + // Remove variant selector VS16 (explicitly emoji) as it is unnecessary and leads to an incorrect URL below + if(unicodeChar.length == 2 && unicodeChar[1] == '\ufe0f') { + unicodeChar = unicodeChar[0]; + } + // get the unicode codepoint from the actual char unicode = emojione.jsEscapeMap[unicodeChar]; + return emojione.imagePathSVG+unicode+'.svg'+emojione.cacheBustParam; } });