Description
When a diagram’s source text exceeds 50 000 characters, Mermaid silently replaces the entire diagram with the placeholder:
- graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa
This truncation occurs even when the diagram is otherwise valid (e.g., a large flowchart with thousands of nodes). Users receive no warning or partial rendering, which leads to loss of information and a confusing experience.
Steps to reproduce
- Create a diagram whose Markdown definition is longer than 50 000 characters. Example: a flowchart with 10 000 nodes (node1, node2, … node10000).
- Embed the diagram in an element with the class mermaid on a web page.
- Load the page in any browser (Chrome, Firefox, etc.).
Result: The diagram is replaced by the “Maximum text size in diagram exceeded” message instead of being rendered.
Screenshots
No response
Code Sample
Setup
- Mermaid version:
- Browser and Version: [Chrome, Edge, Firefox]
Suggested Solutions
- Remove or increase the hard limit – Allow diagrams of any reasonable size to render, or at least raise the limit to a much higher value (e.g., 500 000 characters).
- Add a warning – If a diagram is unusually large, log a warning to the console instead of truncating it.
- Graceful degradation – Consider rendering a partial diagram or splitting it into multip
Additional Context
The limit was likely introduced for performance or security reasons, but it is too restrictive for real‑world use cases. Many users have reported similar issues in the wild (e.g., #7472, #7501). A more flexible approach would improve usability without compromising stability.
Description
When a diagram’s source text exceeds 50 000 characters, Mermaid silently replaces the entire diagram with the placeholder:
This truncation occurs even when the diagram is otherwise valid (e.g., a large flowchart with thousands of nodes). Users receive no warning or partial rendering, which leads to loss of information and a confusing experience.
Steps to reproduce
Result: The diagram is replaced by the “Maximum text size in diagram exceeded” message instead of being rendered.
Screenshots
No response
Code Sample
Setup
Suggested Solutions
Additional Context
The limit was likely introduced for performance or security reasons, but it is too restrictive for real‑world use cases. Many users have reported similar issues in the wild (e.g., #7472, #7501). A more flexible approach would improve usability without compromising stability.