fix: suppress mermaid error overlay

This commit is contained in:
Relakkes Yang 2026-04-25 13:24:26 +08:00
parent 55c5958b55
commit f911d9e79d
2 changed files with 4 additions and 0 deletions

View File

@ -30,6 +30,9 @@ describe('MermaidRenderer', () => {
const previewButton = await screen.findByRole('button', { name: /preview/i })
expect(previewButton).toBeInTheDocument()
expect(initializeMock).toHaveBeenCalledWith(expect.objectContaining({
suppressErrorRendering: true,
}))
fireEvent.click(previewButton)

View File

@ -32,6 +32,7 @@ function initMermaid() {
startOnLoad: false,
theme: 'default',
securityLevel: 'strict',
suppressErrorRendering: true,
fontFamily: 'var(--font-sans)',
})
mermaidInitialized = true