-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Description
Bug Description
Mermaid diagrams are rendered at a fixed/constrained size instead of filling the available container width, causing them to appear clipped or cut off.
Root Cause
Mermaid v11 outputs SVGs with:
- Fixed
widthandheightattributes (e.g.,width="814") - An inline
style="max-width: 814px;"on the root<svg>element
The current code in MermaidBlock.tsx strips the width/height attributes but does not replace them, causing the SVG to fall back to the browser default size (300x150px). Additionally, the inline max-width style is never removed, preventing the SVG from expanding beyond its intrinsic pixel width.
Expected Behavior
Mermaid diagrams should scale to fill the available container width, with the viewBox handling proper content scaling.
Steps to Reproduce
- Create a plan with a mermaid code block containing a moderately complex diagram (e.g., a flowchart with several nodes)
- Open in Plannotator
- Toggle from source to diagram view
- Observe the diagram is clipped/truncated rather than filling the container
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels