Address issue #35: Upgrade Mermaid to v11.12.1 for flowchart rendering#193
Closed
Address issue #35: Upgrade Mermaid to v11.12.1 for flowchart rendering#193
Conversation
Contributor
Code Coverage ReportCurrent Coverage: 51.49% Coverage Details (Summary) |
4 tasks
schuyler
added a commit
that referenced
this pull request
Nov 26, 2025
- Add MPMermaidRenderingTests.m with 9 tests covering: - HTML structure preservation (code block class, source content) - Export includes mermaid scripts - Multiple diagram blocks - Error handling (malformed syntax, empty blocks) - Special characters and Unicode support - Mermaid disabled behavior These tests verify the HTML output from MPRenderer. Actual SVG rendering in JavaScript is tracked in issue #194 (Puppeteer tests). Related to #193
schuyler
added a commit
that referenced
this pull request
Nov 26, 2025
- Add MPMermaidRenderingTests.m with 9 tests covering: - HTML structure preservation (code block class, source content) - Export includes mermaid scripts - Multiple diagram blocks - Error handling (malformed syntax, empty blocks) - Special characters and Unicode support - Mermaid disabled behavior These tests verify the HTML output from MPRenderer. Actual SVG rendering in JavaScript is tracked in issue #194 (Puppeteer tests). Related to #193
- Upgrade Mermaid library from v8.4.3 to v11.12.1 - Update mermaid.init.js to use Promise-based API (Mermaid 10.x+) - Add async/await pattern for rendering calls - Add error handling with user-visible error messages - Add securityLevel: 'loose' for cross-origin rendering support The previous version (8.4.3 from 2020) had issues rendering flowchart diagrams with the graph TD syntax. The new version should resolve these rendering issues. Related to #35
- Add unique ID generation to prevent collisions on re-renders - Add check for mermaid library being loaded before initialization - Add logLevel: 'error' to suppress verbose console logging - Improve error message styling with padding and background Related to #35
Updated MANUAL_TEST_PLAN_ISSUE_18.md to reference the new Mermaid 11.x Promise-based API instead of the older Mermaid 8.0+ version. Related to #35
d09bec8 to
4794972
Compare
Owner
Author
Merge Conflicts ResolvedThe merge conflicts in this PR have been resolved. Since I couldn't push directly to the original branch, I've created a new PR with the resolved conflicts: #262 - Contains all the changes from this PR plus the merge from main to resolve conflicts. I recommend closing this PR in favor of #262. |
schuyler
added a commit
that referenced
this pull request
Jan 10, 2026
#262) ## Summary This PR supersedes #193 with merge conflicts resolved. - Upgrade Mermaid library from v8.4.3 (2020) to v11.12.1 - Update mermaid.init.js to use Promise-based API (Mermaid 10.x+) - Add async/await pattern for rendering with proper error handling - Add unique ID generation to prevent collisions on document re-renders - Add `securityLevel: 'loose'` and `logLevel: 'error'` to configuration - Update documentation to reflect Mermaid 11.x ## Related Issue Related to #35 Supersedes #193 ## Manual Testing Plan A comprehensive 16-test manual testing plan was created covering: - Basic flowchart rendering (graph TD, LR, BT, RL) - Decision nodes, subgraphs, styled nodes, long text labels - Error handling for malformed syntax - Multiple diagrams without ID collisions - Live preview re-rendering - Regression testing for gantt charts (issue #18) - Regression testing for other diagram types (sequence, class, state, pie) - HTML export verification - Unicode/emoji support - Performance with large diagrams ## Review Notes - **Groucho (Architect):** Identified mermaid.min.js and mermaid.init.js as the key files - **Chico (Code Review):** Approved with one fix for ID collisions (addressed) - **Harpo (Documentation):** Updated MANUAL_TEST_PLAN_ISSUE_18.md - **Zeppo (Testing):** Created comprehensive 16-test manual testing plan --------- Co-authored-by: Claude <noreply@anthropic.com>
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.
Summary
securityLevel: 'loose'andlogLevel: 'error'to configurationRelated Issue
Related to #35
Manual Testing Plan
A comprehensive 16-test manual testing plan was created covering:
Review Notes