diff --git a/shared/naturalcrit/codeEditor/autocomplete-emoji.js b/shared/naturalcrit/codeEditor/autocomplete-emoji.js
index f62036e84..eeddb99a7 100644
--- a/shared/naturalcrit/codeEditor/autocomplete-emoji.js
+++ b/shared/naturalcrit/codeEditor/autocomplete-emoji.js
@@ -24,7 +24,6 @@ const showEmojiAutocomplete = function(CodeMirror, editor) {
}).map(function(emoji) {
return {
text: emoji + ":",
- //displayText: `${emoji} - `,
render: function(element, self, data) {
const div = document.createElement('div');
div.innerHTML = ` ${emoji}`;
@@ -50,7 +49,7 @@ const showEmojiAutocomplete = function(CodeMirror, editor) {
const textToCursor = line.slice(0, cursor.ch);
// Check if the text ends with ':xyz'
- if (/:\S+$/.test(textToCursor)) {
+ if (/:[^\s:]+$/.test(textToCursor)) {
CodeMirror.commands.autocomplete(editor);
}
});