From 4a14d997d11236c73165a548908544f108b266b6 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 30 Jan 2024 14:18:58 +0100 Subject: [PATCH 1/2] Update packages/mermaid/src/diagrams/block/blockRenderer.ts Co-authored-by: Alois Klink --- packages/mermaid/src/diagrams/block/blockRenderer.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/mermaid/src/diagrams/block/blockRenderer.ts b/packages/mermaid/src/diagrams/block/blockRenderer.ts index 31790de6e..ed7d51fd2 100644 --- a/packages/mermaid/src/diagrams/block/blockRenderer.ts +++ b/packages/mermaid/src/diagrams/block/blockRenderer.ts @@ -47,11 +47,13 @@ export const draw = async function ( } const root = securityLevel === 'sandbox' - ? d3select(sandboxElement.nodes()[0].contentDocument.body) - : d3select('body'); + ? d3select(sandboxElement.nodes()[0].contentDocument.body) + : d3select('body'); - // @ts-ignore TODO root.select is not callable - const svg = securityLevel === 'sandbox' ? root.select(`[id="${id}"]`) : d3select(`[id="${id}"]`); + const svg = + securityLevel === 'sandbox' + ? root.select(`[id="${id}"]`) + : d3select(`[id="${id}"]`); // Define the supported markers for the diagram const markers = ['point', 'circle', 'cross']; From 2f8f9dd3417abe77e3e65cc11c3aabb9f8aa7b1b Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Tue, 30 Jan 2024 14:36:38 +0100 Subject: [PATCH 2/2] Update packages/mermaid/src/diagrams/block/blockDB.ts Co-authored-by: Alois Klink --- packages/mermaid/src/diagrams/block/blockDB.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/mermaid/src/diagrams/block/blockDB.ts b/packages/mermaid/src/diagrams/block/blockDB.ts index 2902af417..f83d46c11 100644 --- a/packages/mermaid/src/diagrams/block/blockDB.ts +++ b/packages/mermaid/src/diagrams/block/blockDB.ts @@ -154,7 +154,6 @@ const populateBlockDatabase = (_blockList: (Block[] | Block[][]), parent: Block) }; let blocks: Block[] = []; -const links: Link[] = []; let rootBlock = { id: 'root', type: 'composite', children: [], columns: -1 } as Block; const clear = (): void => {