From ba12e336967fad5b32c1a6599aa15296b6d36ccc Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Wed, 18 Oct 2023 16:10:42 -0400 Subject: [PATCH] 21026: sanitized banner and reworked banner.html to accommodate files Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- src/common/html-sanitize.ts | 4 +++- src/views-components/baner/banner.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/common/html-sanitize.ts b/src/common/html-sanitize.ts index 93ebfaa2ef..79ed934958 100644 --- a/src/common/html-sanitize.ts +++ b/src/common/html-sanitize.ts @@ -41,9 +41,11 @@ const domPurifyConfig: TDomPurifyConfig = { 'sub', 'sup', 'ul', + 'span', + 'section' ], ALLOWED_ATTR: ['src', 'width', 'height', 'href', 'alt', 'title', 'style' ], }; -export const sanitizeHTML = (dirtyInput: string): string => DOMPurify.sanitize(dirtyInput, domPurifyConfig); +export const sanitizeHTML = (dirtyString: string): string => DOMPurify.sanitize(dirtyString, domPurifyConfig); diff --git a/src/views-components/baner/banner.tsx b/src/views-components/baner/banner.tsx index 7e39186c09..ac5b89439c 100644 --- a/src/views-components/baner/banner.tsx +++ b/src/views-components/baner/banner.tsx @@ -10,6 +10,7 @@ import bannerActions from "store/banner/banner-action"; import { ArvadosTheme } from "common/custom-theme"; import servicesProvider from "common/service-provider"; import { Dispatch } from "redux"; +import { sanitizeHTML } from "common/html-sanitize"; type CssRules = "dialogContent" | "dialogContentIframe"; @@ -92,7 +93,7 @@ export const BannerComponent = (props: BannerComponentProps) => { >
-
+