FIX: emoji autocomplete triggering incorrectly

FIX: emoji autocomplete triggering incorrectly

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.

diff --git a/app/assets/javascripts/discourse/app/components/d-editor.js b/app/assets/javascripts/discourse/app/components/d-editor.js
index b8fda2c..4917acc 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)
         );
 

GitHub sha: 08044b4f

1 Like