From bcda7d227d7c2620cf70a51c37bc28b7212bf4e4 Mon Sep 17 00:00:00 2001 From: Pascal Jufer Date: Mon, 22 May 2023 17:19:21 +0200 Subject: [PATCH] Disable disable depreacted marked options (#18685) --- api/src/utils/md.ts | 2 +- app/src/utils/md.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/api/src/utils/md.ts b/api/src/utils/md.ts index af0063598a..ca98f73c6c 100644 --- a/api/src/utils/md.ts +++ b/api/src/utils/md.ts @@ -5,5 +5,5 @@ import sanitizeHTML from 'sanitize-html'; * Render and sanitize a markdown string */ export function md(str: string): string { - return sanitizeHTML(marked(str)); + return sanitizeHTML(marked(str, { headerIds: false, mangle: false })); } diff --git a/app/src/utils/md.ts b/app/src/utils/md.ts index fbc65c3b49..030a7edca6 100644 --- a/app/src/utils/md.ts +++ b/app/src/utils/md.ts @@ -25,6 +25,8 @@ export function md(str: string, options: Options = { target: '_self' }): string return dompurify.sanitize( marked(str, { renderer, + headerIds: false, + mangle: false, }), { ADD_ATTR: ['target'] } );