From a376bc09015d3286f87f24b4a70c73d85d5b2f1d Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 26 Aug 2015 16:27:54 +0800 Subject: [PATCH] FIX: Allow emoji to be bounded by non-word characters in preview. --- app/assets/javascripts/discourse/lib/emoji/emoji.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb index ef7856a7486..12cb1711ba8 100644 --- a/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb +++ b/app/assets/javascripts/discourse/lib/emoji/emoji.js.erb @@ -113,7 +113,7 @@ function checkPrev(prev) { var lastToken = prev[prev.length-1]; if (lastToken && lastToken.charAt) { var lastChar = lastToken.charAt(lastToken.length-1); - if (!/\s/.test(lastChar)) return false; + if (!/\W/.test(lastChar)) return false; } } return true;