From cd49c12181bbcdd099827855075457f14ecccbac Mon Sep 17 00:00:00 2001 From: lloydzhou Date: Tue, 20 Aug 2024 23:00:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=9F=A5=E7=9C=8B?= =?UTF-8?q?=E5=85=A8=E9=83=A8=E6=8C=89=E9=92=AE=E5=AF=BC=E8=87=B4artifacts?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/markdown.tsx | 7 ++----- app/styles/globals.scss | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/components/markdown.tsx b/app/components/markdown.tsx index 5515164c4..ae05a458b 100644 --- a/app/components/markdown.tsx +++ b/app/components/markdown.tsx @@ -79,6 +79,7 @@ export function PreCode(props: { children: any }) { setMermaidCode((mermaidDom as HTMLElement).innerText); } const htmlDom = ref.current.querySelector("code.language-html"); + const refText = ref.current?.innerText; if (htmlDom) { setHtmlCode((htmlDom as HTMLElement).innerText); } else if (refText?.startsWith(" { - setTimeout(renderArtifacts, 1); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [refText]); - const enableArtifacts = useMemo( () => plugins?.includes(Plugin.Artifacts), [plugins], @@ -119,6 +115,7 @@ export function PreCode(props: { children: any }) { codeElement.style.whiteSpace = "pre-wrap"; } }); + setTimeout(renderArtifacts, 1); } }, []); diff --git a/app/styles/globals.scss b/app/styles/globals.scss index 96d6402dc..564875b90 100644 --- a/app/styles/globals.scss +++ b/app/styles/globals.scss @@ -314,7 +314,9 @@ code{ height: fit-content; display: inline-flex; justify-content: center; + pointer-events: none; button{ + pointer-events: auto; margin-top: 3em; margin-bottom: 4em; padding: 5px 16px;