diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 9388e912a..894c084b6 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -69,6 +69,20 @@ renderer.html = function (html) { return html; }; +renderer.code = function(code, infostring, escaped) { + const lang = (infostring || '').match(/^\S*/)?.[0]; + + code = code.replace(/
${escaped ? code : escape(code, true)}\n`;
+ }
+
+ return `${escaped ? code : escape(code, true)}\n`;
+};
+
// Don't wrap {{ Spans alone on a line, or {{ Divs in tags renderer.paragraph = function(text){ let match; @@ -834,7 +848,7 @@ module.exports = { globalPageNumber = pageNumber; rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n
\n`) - .replace(/^(:+)$/gm, (match)=>`${``.repeat(match.length)}\n`); + .replace(/^(:+)$/gm, (match)=>`${``.repeat(match.length)}\n`); const opts = Marked.defaults; rawBrewText = opts.hooks.preprocess(rawBrewText);