diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index 5fd79893a00..ffeac152a60 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -338,8 +338,7 @@ export default Ember.Component.extend({ }, onKeyUp(text, cp) { - const subtext = text.substring(0, cp); - return subtext.match(/(:(?!:).?[\w-]*:?(?!:)(?:t\d?)?:?) ?$/gm); + return text.substring(0, cp).match(/(:(?!:).?[\w-]*:?(?!:)(?:t\d?)?:?) ?$/g); }, transformComplete(v) { diff --git a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 index 27f6bef6116..4ce4adb6ee5 100644 --- a/app/assets/javascripts/discourse/lib/autocomplete.js.es6 +++ b/app/assets/javascripts/discourse/lib/autocomplete.js.es6 @@ -363,7 +363,7 @@ export default function(options) { if (options.key) { if (options.onKeyUp && key !== options.key) { - var match = options.onKeyUp(me.val(), cp); + let match = options.onKeyUp(me.val(), cp); if (match) { completeStart = cp - match[0].length; completeEnd = completeStart + match[0].length - 1;