From 4fc030afc835f1a68e6e7e878d2ebff6ae62c69e Mon Sep 17 00:00:00 2001 From: blackeuler Date: Thu, 9 May 2024 15:54:01 -0400 Subject: [PATCH] add dangerousSkipSantization for display.html --- src/components/RenderHTML/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/RenderHTML/index.tsx b/src/components/RenderHTML/index.tsx index 08058dd..c250b9c 100644 --- a/src/components/RenderHTML/index.tsx +++ b/src/components/RenderHTML/index.tsx @@ -3,6 +3,7 @@ import sanitizeHtml, { IOptions } from 'sanitize-html' interface RenderHTMLProps { html: string + dangerousSkipSantization?: boolean } const config: IOptions = { @@ -69,10 +70,10 @@ const config: IOptions = { } export default function RenderHTML(props: RenderHTMLProps) { - const { html } = props + const { html, dangerousSkipSantization } = props const sanitized = useMemo(() => { - return sanitizeHtml(html, config) + return dangerousSkipSantization ? html : sanitizeHtml(html, config) }, [html]) return (