From 29735620663b4b96a68ebf8fd50699bcaefe9317 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 10 Dec 2024 09:39:32 -0800 Subject: [PATCH] Sanitize markdown when previewing report header/footer (#476) Signed-off-by: Joshua Li --- .../__tests__/__snapshots__/main.test.tsx.snap | 16 ++++++++-------- .../__snapshots__/reports_table.test.tsx.snap | 8 ++++---- .../report_settings/report_settings.tsx | 7 +++++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/public/components/main/__tests__/__snapshots__/main.test.tsx.snap b/public/components/main/__tests__/__snapshots__/main.test.tsx.snap index c64ee236..d9a0821d 100644 --- a/public/components/main/__tests__/__snapshots__/main.test.tsx.snap +++ b/public/components/main/__tests__/__snapshots__/main.test.tsx.snap @@ -73,7 +73,7 @@ exports[`
panel render component 1`] = ` />
panel render component 1`] = `
panel render component after create success 1`] = ` />
panel render component after create success 1`] = `
panel render component after delete success 1`] = ` />
panel render component after delete success 1`] = `
panel render component after edit success 1`] = ` />
panel render component after edit success 1`] = `
panel render component 1`] = `
panel render component 1`] = `
panel render component 1`] = ` exports[` panel render empty component 1`] = `
panel render empty component 1`] = `
- Promise.resolve(converter.makeHtml(markdown)) + Promise.resolve(DOMPurify.sanitize(converter.makeHtml(markdown))) } /> @@ -380,7 +383,7 @@ export function ReportSettings(props: ReportSettingProps) { ['unordered-list', 'ordered-list', 'checked-list'], ]} generateMarkdownPreview={(markdown) => - Promise.resolve(converter.makeHtml(markdown)) + Promise.resolve(DOMPurify.sanitize(converter.makeHtml(markdown))) } />