From 61f74ffc5e08c399e49d820a675f7ca8bd5f7f11 Mon Sep 17 00:00:00 2001 From: darshanr0107 Date: Wed, 5 Nov 2025 14:54:51 +0530 Subject: [PATCH] fix: incorrect section number logic by using index % (MAX_SECTIONS - 1) on-behalf-of: @Mermaid-Chart --- packages/mermaid/src/diagrams/mindmap/mindmapDb.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/diagrams/mindmap/mindmapDb.ts b/packages/mermaid/src/diagrams/mindmap/mindmapDb.ts index 71df343b6..07f945d61 100644 --- a/packages/mermaid/src/diagrams/mindmap/mindmapDb.ts +++ b/packages/mermaid/src/diagrams/mindmap/mindmapDb.ts @@ -204,7 +204,7 @@ export class MindmapDB { // For other nodes, inherit parent's section number if (node.children) { for (const [index, child] of node.children.entries()) { - const childSectionNumber = node.level === 0 ? (index % MAX_SECTIONS) - 1 : sectionNumber; + const childSectionNumber = node.level === 0 ? index % (MAX_SECTIONS - 1) : sectionNumber; this.assignSections(child, childSectionNumber); } }