From 4493d86fd5fb17962399cea0790093dd2296e2bc Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Sun, 13 Nov 2022 20:05:52 -0600 Subject: [PATCH] fix injection curly syntax --- shared/naturalcrit/markdown.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index c0aeb3892..98f843505 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -33,7 +33,6 @@ const mustacheSpans = { tokenizer(src, tokens) { const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token const inlineRegex = /{{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)*|}}/g; - // ^ *{{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)* *$|^ *}}$ const match = completeSpan.exec(src); if(match) { //Find closing delimiter @@ -131,7 +130,7 @@ const mustacheInjectInline = { level : 'inline', start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{((?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*)}/g; + const inlineRegex = /{(?:(?=(:(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*))\1)*}/g; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1];