Browse Source

[Glitch] Skip VS15 (Emoji textual presentation)

Port a060beee72 to glitch-soc
closed-social-glitch-2
Thibaut Girka 5 years ago
committed by ThibG
parent
commit
b3fdd166e8
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      app/javascript/flavours/glitch/util/emoji/index.js

+ 4
- 0
app/javascript/flavours/glitch/util/emoji/index.js View File

@ -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);

Loading…
Cancel
Save