Fix > and < display in markdown interpreter

This commit is contained in:
lowlighter
2021-04-22 12:24:11 +02:00
parent 215dabda32
commit 1b7ff7ec25

View File

@@ -163,7 +163,7 @@
/**Markdown-html sanitizer-interpreter */
export async function markdown(text, {mode = "inline", codelines = Infinity} = {}) {
//Sanitize user input once to prevent injections and parse into markdown
let rendered = await marked(htmlsanitize(text).replace(/^>/gm, ">"), {
let rendered = await marked(htmlunescape(htmlsanitize(text)), {
highlight(code, lang) {
return lang in prism.languages ? prism.highlight(code, prism.languages[lang]) : code
},