mirror of
https://github.com/discourse/discourse.git
synced 2025-02-16 18:24:52 -06:00
FIX: Better boundary checking for emoji
This commit is contained in:
parent
aab8eaac03
commit
965ff51efe
@ -80,6 +80,10 @@
|
||||
translationColonRegexp.lastIndex = 0;
|
||||
var m = translationColonRegexp.exec(text);
|
||||
if (m && m[0] && text.indexOf(m[0]) === 0) {
|
||||
|
||||
// Check outer edge
|
||||
var lastChar = text.charAt(m[0].length);
|
||||
if (lastChar && (lastChar !== ' ' && lastChar !== "\n")) return;
|
||||
contents = imageFor(translationsWithColon[m[0]]);
|
||||
if (contents) {
|
||||
return [m[0].length, contents];
|
||||
|
Loading…
Reference in New Issue
Block a user