From 04a7f989f06b803500af66e4565e1a9f2753ddbb Mon Sep 17 00:00:00 2001 From: Shinji-Li <1349021570@qq.com> Date: Fri, 12 Apr 2024 14:39:10 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=89=B9=E6=AE=8A=E5=BC=95=E5=85=A5=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E7=9A=84=E4=B8=8A=E5=B1=82=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#178)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :bug: fix: slove DOMPurify import error problem * :sparkles: feat: update snapshot --- src/Highlight/hooks/useShiki.tsx | 2 +- tests/__snapshots__/demo.test.tsx.snap | 74 +++----------------------- 2 files changed, 7 insertions(+), 69 deletions(-) diff --git a/src/Highlight/hooks/useShiki.tsx b/src/Highlight/hooks/useShiki.tsx index d020fbe9..cb30c458 100644 --- a/src/Highlight/hooks/useShiki.tsx +++ b/src/Highlight/hooks/useShiki.tsx @@ -1,4 +1,4 @@ -import * as DOMPurify from 'dompurify'; +import DOMPurify from 'dompurify'; import { useEffect, useState } from 'react'; import { getHighlighter, type Highlighter } from 'shiki/bundle/web'; import { themeConfig } from '../theme'; diff --git a/tests/__snapshots__/demo.test.tsx.snap b/tests/__snapshots__/demo.test.tsx.snap index 76b80899..7dec2564 100644 --- a/tests/__snapshots__/demo.test.tsx.snap +++ b/tests/__snapshots__/demo.test.tsx.snap @@ -15936,40 +15936,14 @@ export interface MarkdownProps { const MemoHr = memo((props) => ( - - )); -const MemoDetails = memo((props) => - - ); +const MemoDetails = memo((props) => ); const MemoImage = memo((props) => - - ); -const MemoAlink = memo((props) => - - ); + + ); +const MemoAlink = memo((props) => ); -const Markdown = memo - - ( +const Markdown = memo( ({ children, className, @@ -15993,44 +15967,17 @@ const Markdown = memo return ( - - - - {children} - - - - ); }, ); -export default withProvider(Markdown) as React.FC - - ; +export default withProvider(Markdown) as React.FC; - - - - - @@ -17296,16 +17243,7 @@ id sem consectetuer libero luctus adipiscing. - - - - Custom Html Dom Render