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'] } );