From 6a95ed57ca0f7782a0ef889463a79e826c51721d Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Fri, 24 Mar 2023 15:15:08 -0500 Subject: [PATCH] escape tokenization of injection if preceded by another injection. --- shared/naturalcrit/markdown.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 16623b8a5..50bbfe827 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -134,7 +134,7 @@ const mustacheInjectInline = { const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; - if(!lastToken) + if(!lastToken || lastToken.type == 'mustacheInjectInline') return false; const tags = ` ${processStyleTags(match[1])}`; @@ -169,7 +169,8 @@ const mustacheInjectBlock = { const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; - if(!lastToken) + console.log(lastToken); + if(!lastToken || lastToken.type == 'mustacheInjectBlock') return false; lastToken.originalType = 'mustacheInjectBlock';