diff --git a/lib/renderer.js b/lib/renderer.js index 469ccb5..878c271 100644 --- a/lib/renderer.js +++ b/lib/renderer.js @@ -104,10 +104,7 @@ function tokenizeEditor(editorElement: HTMLElement, preElement: HTMLPreElement): * @return {Node} the html template node containing the result */ function internalRender(markdownText: string): Node { - // Remove the since otherwise marked will escape it - // https://github.com/chjj/marked/issues/354 - let text = markdownText.replace(/^\s*\s*/i, ''); - let html = DOMPurify.sanitize(marked(text, { breaks: true })); + let html = DOMPurify.sanitize(marked(markdownText, { breaks: true })); let template = document.createElement('template'); template.innerHTML = html.trim(); return template.content.cloneNode(true);