From 50991dfe9218827dd4f195216d55c4da524e01ef Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 11 Jul 2021 00:33:47 -0400 Subject: [PATCH] MustacheDivs to Marked.js extension --- shared/naturalcrit/markdown.js | 138 +++++++++++++++++---------------- 1 file changed, 70 insertions(+), 68 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 3bc6c7693..a8c287c93 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -20,20 +20,20 @@ renderer.paragraph = function(text){ if(text.startsWith('${match[1]}

` : ''}{ - if(splitText) r.push(Markdown.parseInline(splitText, { renderer: renderer })); - - const block = matches[matchIndex] ? matches[matchIndex].trimLeft() : ''; - if(block && block.startsWith('{')) { - const values = processStyleTags(block.substring(2)); - r.push(`
`); - blockCount++; - } else if(block == '}}' && blockCount !== 0){ - r.push('
'); - blockCount--; - } - - matchIndex++; - - return r; - }, []).join(''); - return res; - } else { - if(!matches) { - return `${text}`; } + }, + renderer(token) { + return `