diff --git a/shared/naturalcrit/codeEditor/autocomplete-emoji.js b/shared/naturalcrit/codeEditor/autocomplete-emoji.js index 87950322f..de550ff66 100644 --- a/shared/naturalcrit/codeEditor/autocomplete-emoji.js +++ b/shared/naturalcrit/codeEditor/autocomplete-emoji.js @@ -60,7 +60,16 @@ const showEmojiAutocomplete = function(CodeMirror, editor) { // Get the text from the start of the line to the cursor const textToCursor = line.slice(0, cursor.ch); - + + // Do not autosuggest emojis in curly span/div properties + if(line.includes('{{')) { + const curlyToCursor = textToCursor.slice(textToCursor.indexOf(`{{`)); + const curlySpanRegex = /{{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\1$/g; + + if (regex.test(curlyToCursor)) + return; + } + // Check if the text ends with ':xyz' if (/:[^\s:]+$/.test(textToCursor)) { CodeMirror.commands.autocomplete(editor);