mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
FIX: Better boundary checking for emoji
This commit is contained in:
parent
aab8eaac03
commit
965ff51efe
1 changed files with 4 additions and 0 deletions
|
@ -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 a new issue