about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-09-03 17:30:55 +0200
committerThibG <thib@sitedethib.com>2018-09-03 18:18:50 +0200
commitb3fdd166e819819a7a8f7cfa540986af047c05fa (patch)
tree81f59abb248e5ac569bccd6a008e642fe60fb25b
parent8e862ecf8dfde495b0030fe16c856f69da60dd3f (diff)
[Glitch] Skip VS15 (Emoji textual presentation)
Port a060beee726de5295e1f608231975a90b7709a0a to glitch-soc
-rw-r--r--app/javascript/flavours/glitch/util/emoji/index.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/util/emoji/index.js b/app/javascript/flavours/glitch/util/emoji/index.js
index c6416db2d..82a1ef89c 100644
--- a/app/javascript/flavours/glitch/util/emoji/index.js
+++ b/app/javascript/flavours/glitch/util/emoji/index.js
@@ -62,6 +62,10 @@ const emojify = (str, customEmojis = {}) => {
       const title = shortCode ? `:${shortCode}:` : '';
       replacement = `<img draggable="false" class="emojione" alt="${match}" title="${title}" src="${assetHost}/emoji/${filename}.svg" />`;
       rend = i + match.length;
+      // If the matched character was followed by VS15 (for selecting text presentation), skip it.
+      if (str.codePointAt(rend) === 65038) {
+        rend += 1;
+      }
     }
     rtn += str.slice(0, i) + replacement;
     str = str.slice(rend);