From 2542d7e0a2f517eb739f2ac72a271a203aa4ad13 Mon Sep 17 00:00:00 2001 From: Jan Beckmann Date: Sun, 11 Mar 2018 20:02:55 +0100 Subject: Hide emoji popup after multiple spaces or blank lines Fixes #40620,#33678 --- app/assets/javascripts/gfm_auto_complete.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/assets/javascripts/gfm_auto_complete.js') diff --git a/app/assets/javascripts/gfm_auto_complete.js b/app/assets/javascripts/gfm_auto_complete.js index 57a1fa107e5..28c04b36d45 100644 --- a/app/assets/javascripts/gfm_auto_complete.js +++ b/app/assets/javascripts/gfm_auto_complete.js @@ -131,9 +131,8 @@ class GfmAutoComplete { callbacks: { ...this.getDefaultCallbacks(), matcher(flag, subtext) { - const relevantText = subtext.trim().split(/\s/).pop(); const regexp = new RegExp(`(?:[^${glRegexp.unicodeLetters}0-9:]|\n|^):([^:]*)$`, 'gi'); - const match = regexp.exec(relevantText); + const match = regexp.exec(subtext); return match && match.length ? match[1] : null; }, -- cgit v1.2.3