Repository navigation
fix(editor): show Mermaid render diagnostics - #741
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Collaborator
Author
2 tasks done
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Mermaid failures currently show only “Unable to render Mermaid diagram,” hiding the parser's explanation and line number. Show the diagnostic as plain text in both editor previews and standalone previews, with wrapping and scrolling for long messages. Clicking or pressing Enter on the editor preview still reveals the original source.
Clear error styling and stale zoom controls when rendering changes between failure and success. Disable Mermaid's fallback error SVG so the error stays inside Markra's preview. Diagnostics never modify Markdown source or interpret embedded HTML.
Refs #740. The participant-name collision is tracked separately in mermaid-js/mermaid#8280; this PR improves error reporting and does not change Mermaid syntax handling.
Validation
pnpm --filter @markra/editor test src/mermaid.test.ts src/mermaid.integration.test.ts src/codemirror/code-block.test.ts— 48 passed, including a real Mermaid parser failure, safe text rendering, and source-correction/theme recovery.pnpm --filter @markra/app test src/components/MarkdownPreviewDocument.test.tsx src/components/MarkdownExportDocument.test.tsx src/styles.test.ts— 78 passed.pnpm --filter @markra/desktop test src/quicklook/QuickLookPreview.test.tsx— 2 passed.pnpm --filter @markra/editor --filter @markra/app buildandpnpm --filter @markra/editor --filter @markra/app typecheck:test— passed.