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];