[Glitch] Skip VS15 (Emoji textual presentation)

Port f21c1c58ce to glitch-soc
th-downstream
Thibaut Girka 6 years ago committed by ThibG
parent c11159af5f
commit c50c4d4a8f

@ -62,6 +62,10 @@ const emojify = (str, customEmojis = {}) => {
const title = shortCode ? `:${shortCode}:` : ''; const title = shortCode ? `:${shortCode}:` : '';
replacement = `<img draggable="false" class="emojione" alt="${match}" title="${title}" src="${assetHost}/emoji/${filename}.svg" />`; replacement = `<img draggable="false" class="emojione" alt="${match}" title="${title}" src="${assetHost}/emoji/${filename}.svg" />`;
rend = i + match.length; 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; rtn += str.slice(0, i) + replacement;
str = str.slice(rend); str = str.slice(rend);

Loading…
Cancel
Save