mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 14:52:39 +00:00
Don't autosuggest emojis inside injectors
This commit is contained in:
@@ -61,10 +61,10 @@ const showAutocompleteEmoji = function(CodeMirror, editor) {
|
|||||||
// Get the text from the start of the line to the cursor
|
// Get the text from the start of the line to the cursor
|
||||||
const textToCursor = line.slice(0, cursor.ch);
|
const textToCursor = line.slice(0, cursor.ch);
|
||||||
|
|
||||||
// Do not autosuggest emojis in curly span/div properties
|
// Do not autosuggest emojis in curly span/div/injector properties
|
||||||
if(line.includes('{{')) {
|
if(line.includes('{')) {
|
||||||
const curlyToCursor = textToCursor.slice(textToCursor.indexOf(`{{`));
|
const curlyToCursor = textToCursor.slice(textToCursor.indexOf(`{`));
|
||||||
const curlySpanRegex = /{{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\1$/g;
|
const curlySpanRegex = /{(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\1$/g;
|
||||||
|
|
||||||
if (regex.test(curlyToCursor))
|
if (regex.test(curlyToCursor))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user