diff --git a/packages/app/src/components/markdown/fence/mermaid/build-runtime.mjs b/packages/app/src/components/markdown/fence/mermaid/build-runtime.mjs index 6ed821cea..26ffd2489 100644 --- a/packages/app/src/components/markdown/fence/mermaid/build-runtime.mjs +++ b/packages/app/src/components/markdown/fence/mermaid/build-runtime.mjs @@ -63,10 +63,25 @@ const html = ` #diagram svg { display: block; } + /* Keep Mermaid's temporary render container unscaled when the host mounts this frame + at 0x0 or 240x240 before the diagram's own dimensions are known. */ + #staging-clip { + position: fixed; + width: 0; + height: 0; + overflow: hidden; + visibility: hidden; + pointer-events: none; + } + #staging { + width: 16384px; + height: 16384px; + }
+