diff --git a/lib/helpers.js b/lib/helpers.js index 30e694bc98..bf531a2b38 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -515,21 +515,17 @@ let domPurify = null; export function renderMarkdown(md) { if (marked === null) { - marked = require('marked'); + ({marked} = require('marked')); if (domPurify === null) { const createDOMPurify = require('dompurify'); domPurify = createDOMPurify(); } - marked.setOptions({ - silent: true, - sanitize: true, - sanitizer: html => domPurify.sanitize(html), - }); + marked.setOptions({silent: true}); } - return marked(md); + return domPurify.sanitize(marked(md)); } export const GHOST_USER = {