From 08044b4f946decf75efc74e1e4151ed30168285f Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 9 Jun 2020 17:22:51 +1000 Subject: [PATCH] FIX: emoji autocomplete triggering incorrectly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous to this fix the we were checking for non letters. This was mismatching what pretty-text/addon/emoji.js was doing. `รน:su` and `1:su` Would lead to an emoji autocomplete popup in the composer. --- app/assets/javascripts/discourse/app/components/d-editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.js index b8fda2c5b8e..4917acc81cd 100644 --- a/app/assets/javascripts/discourse/app/components/d-editor.js +++ b/app/assets/javascripts/discourse/app/components/d-editor.js @@ -436,7 +436,7 @@ export default Component.extend({ return false; } - const matches = /(?:^|[^a-z])(:(?!:).?[\w-]*:?(?!:)(?:t\d?)?:?) ?$/gi.exec( + const matches = /(?:^|[>.,\/#!$%^&*;:{}=\-_`~()])(:(?!:).?[\w-]*:?(?!:)(?:t\d?)?:?) ?$/gi.exec( text.substring(0, cp) );