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;