From 8b204a74f52e14296afe5e605e4383b8a9257d13 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 10 Dec 2024 17:39:47 +0000 Subject: [PATCH] Sanitize markdown when previewing report header/footer (#476) Signed-off-by: Joshua Li (cherry picked from commit 29735620663b4b96a68ebf8fd50699bcaefe9317) Signed-off-by: github-actions[bot] --- .../__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 55d94177..68172576 100644 --- a/public/components/main/__tests__/__snapshots__/main.test.tsx.snap +++ b/public/components/main/__tests__/__snapshots__/main.test.tsx.snap @@ -59,7 +59,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))) } /> @@ -349,7 +352,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))) } />