From 7fb1b4dded70543a666fec9640f3a5e8b4815848 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Tue, 21 Jan 2014 13:32:59 -0500 Subject: [PATCH] FIX: Can do multiple `:)` emojis on one line --- plugins/emoji/assets/javascripts/emoji.js.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/emoji/assets/javascripts/emoji.js.erb b/plugins/emoji/assets/javascripts/emoji.js.erb index 17fbbabce34..8d9370940d8 100644 --- a/plugins/emoji/assets/javascripts/emoji.js.erb +++ b/plugins/emoji/assets/javascripts/emoji.js.erb @@ -61,10 +61,11 @@ Discourse.Dialect.registerInline(':', function(text, match, prev) { var endPos = text.indexOf(':', 1), + firstSpace = text.search(/\s/), contents; // If there is no trailing colon, check our translations that begin with colons - if (endPos === -1) { + if (endPos === -1 || (firstSpace !== -1 && endPos > firstSpace)) { translationColonRegexp.lastIndex = 0; var match = translationColonRegexp.exec(text); if (match && match[0]) {