chore(editor): disable deprecated marked options

This commit is contained in:
kolaente 2023-06-21 15:12:45 +02:00
parent 83c0ef4e8b
commit 25bd26bea6
No known key found for this signature in database
GPG Key ID: F40E70337AB24C9B
1 changed files with 4 additions and 1 deletions

View File

@ -226,7 +226,10 @@ function findNthIndex(str: string, n: number) {
function renderPreview() {
setupMarkdownRenderer(checkboxId.value)
preview.value = DOMPurify.sanitize(marked(text.value), {ADD_ATTR: ['target']})
preview.value = DOMPurify.sanitize(marked(text.value, {
mangle: false,
headerIds: false,
}), {ADD_ATTR: ['target']})
// Since the render function is synchronous, we can't do async http requests in it.
// Therefore, we can't resolve the blob url at (markdown) compile time.