Disable disable depreacted marked options (#18685)

This commit is contained in:
Pascal Jufer
2023-05-22 17:19:21 +02:00
committed by GitHub
parent 946d874ef3
commit bcda7d227d
2 changed files with 3 additions and 1 deletions

View File

@@ -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 }));
}

View File

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