0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-05-07 16:38:38 +00:00

Fix issue with closing brace not highlighting

This commit is contained in:
Gazook89
2026-05-02 15:36:56 -05:00
parent 5426aa82c1
commit a34a5d187b
@@ -182,13 +182,14 @@ export function tokenizeCustomMarkdown(text) {
} }
if(lineText.includes('{') && lineText.includes('}')) { if(lineText.includes('{') && lineText.includes('}')) {
const injectionRegex = /(?:^|[^{\n])({(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\2})/gm; const injectionRegex = /(?:^|[^{\n])({(?=((?:[:=](?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':={}\s]*)*))\2})/gmd;
let match; let match;
while ((match = injectionRegex.exec(lineText)) !== null) { while ((match = injectionRegex.exec(lineText)) !== null) {
console.log(match[2]);
tokens.push({ tokens.push({
line : lineNumber, line : lineNumber,
from : match.index, from : match.indices[1][0],
to : match.index + match[1].length, to : match.indices[1][1],
type : customTags.injection, type : customTags.injection,
}); });
} }