From a94194e1cd1e2d99b8972455bd7af51a5de6669a Mon Sep 17 00:00:00 2001 From: Innei Date: Sun, 3 Mar 2024 23:19:59 +0800 Subject: [PATCH] fix: update copy button Signed-off-by: Innei --- .../ui/code-highlighter/CodeHighlighter.tsx | 3 --- src/components/ui/code-highlighter/shiki/Shiki.tsx | 13 +++++-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/components/ui/code-highlighter/CodeHighlighter.tsx b/src/components/ui/code-highlighter/CodeHighlighter.tsx index 80f1bf1b0b..5048bd04bd 100644 --- a/src/components/ui/code-highlighter/CodeHighlighter.tsx +++ b/src/components/ui/code-highlighter/CodeHighlighter.tsx @@ -136,9 +136,6 @@ const useLoadHighlighter = (ref: React.RefObject) => { }) } else { requestAnimationFrame(() => { - window.Prism?.highlightAll() - // highlightAll twice - requestAnimationFrame(() => { window.Prism?.highlightAll() }) diff --git a/src/components/ui/code-highlighter/shiki/Shiki.tsx b/src/components/ui/code-highlighter/shiki/Shiki.tsx index 08a52e77ca..bc22290b14 100644 --- a/src/components/ui/code-highlighter/shiki/Shiki.tsx +++ b/src/components/ui/code-highlighter/shiki/Shiki.tsx @@ -132,10 +132,7 @@ export const ShikiHighLighter: FC = (props) => { {!filename && !!language && (
{language.toUpperCase()}
@@ -144,9 +141,9 @@ export const ShikiHighLighter: FC = (props) => { @@ -178,7 +175,7 @@ export const ShikiHighLighter: FC = (props) => { className={`absolute bottom-0 left-0 right-0 flex justify-center py-2 duration-200 ${ ['mask-both-lg', 'mask-b-lg'].includes(maskClassName) ? '' - : 'opacity-0' + : 'pointer-events-none opacity-0' }`} >