diff --git a/packages/mermaid/src/mermaidAPI.ts b/packages/mermaid/src/mermaidAPI.ts index b31378ce6..16421ba9b 100644 --- a/packages/mermaid/src/mermaidAPI.ts +++ b/packages/mermaid/src/mermaidAPI.ts @@ -476,6 +476,9 @@ const render = async function ( try { diag = await getDiagramFromText(text); } catch (error) { + if (config.suppressErrorRendering) { + throw error; + } diag = new Diagram('error'); parseEncounteredException = error; }