fix: Mermaid diagrams inside toggle containers do not render correctly (#12343)

This commit is contained in:
Tom Moor
2026-05-13 08:53:43 -04:00
committed by GitHub
parent e325867716
commit 9603e6d7c8
+5 -2
View File
@@ -294,8 +294,11 @@ function getNewState({
const decorations: Decoration[] = [];
let newEditingId: string | undefined;
// Find all blocks that represent Mermaid diagrams (supports both "mermaid" and "mermaidjs")
const blocks = findBlockNodes(doc).filter((item) => isMermaid(item.node));
// Find all blocks that represent Mermaid diagrams (supports both "mermaid" and "mermaidjs"),
// descending into containers so diagrams inside toggle blocks are also discovered.
const blocks = findBlockNodes(doc, true).filter((item) =>
isMermaid(item.node)
);
blocks.forEach((block) => {
const existingDecorations = pluginState.decorationSet.find(