mirror of
https://github.com/outline/outline.git
synced 2026-11-21 05:24:03 +03:00
classDiagram, erDiagram, and requirementDiagram render node labels using <foreignObject> elements. Browsers skip layout of <foreignObject> content inside visibility:hidden SVGs, causing mermaid's layout engine to measure zero-size labels and produce inflated viewBox dimensions (thousands of pixels for a small diagram). Switching the render container from visibility:hidden to opacity:0 keeps the element in the render tree and fully laid out — preserving correct getBBox() results for both regular SVG elements and foreignObject content — without making the rendering visible to the user. The cache prefix is bumped to v3 so previously mis-sized diagrams cached under v2 are discarded and re-rendered correctly.