From f77d9dcd064130618b6f7a676f869287bb5ef6ff Mon Sep 17 00:00:00 2001 From: Peli de Halleux Date: Wed, 15 Jan 2025 01:11:22 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20JS=20fenced=20code=20?= =?UTF-8?q?blocks=20and=20suppress=20errors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/sample/genaisrc/envoutput.genai.mjs | 1 + packages/web/src/Mermaid.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/sample/genaisrc/envoutput.genai.mjs b/packages/sample/genaisrc/envoutput.genai.mjs index 15291345a..e7925aeed 100644 --- a/packages/sample/genaisrc/envoutput.genai.mjs +++ b/packages/sample/genaisrc/envoutput.genai.mjs @@ -4,6 +4,7 @@ output.heading(3, "hello world") $`Write a poem` +output.fence(`let x = "abc"`, "js") output.itemValue("item", "value") output.fence("This is a fence") output.fence( diff --git a/packages/web/src/Mermaid.tsx b/packages/web/src/Mermaid.tsx index 2a29496f6..793c52a46 100644 --- a/packages/web/src/Mermaid.tsx +++ b/packages/web/src/Mermaid.tsx @@ -26,7 +26,7 @@ function MermaidInternal(props: { value: string }) { useEffect(() => { if (ref.current) { mermaid.initialize({ theme }) - mermaid.run({ nodes: [ref.current] }) + mermaid.run({ nodes: [ref.current], suppressErrors: true }) } }, [value, theme]) if (!value) return null