diff --git a/.changeset/ninety-roses-turn.md b/.changeset/ninety-roses-turn.md index a37c6c9e8..1eb3a8189 100644 --- a/.changeset/ninety-roses-turn.md +++ b/.changeset/ninety-roses-turn.md @@ -2,6 +2,6 @@ 'mermaid': patch --- -fix:Add validation for blocks exceeding column width. +fix: Add validation for blocks exceeding column width This update adds a validation check that triggers an error message when a block's width exceeds the defined column layout. diff --git a/packages/mermaid/src/diagrams/block/blockDB.ts b/packages/mermaid/src/diagrams/block/blockDB.ts index 27702bb32..8831ad90e 100644 --- a/packages/mermaid/src/diagrams/block/blockDB.ts +++ b/packages/mermaid/src/diagrams/block/blockDB.ts @@ -102,7 +102,9 @@ const populateBlockDatabase = (_blockList: Block[], parent: Block): void => { typeof block.widthInColumns === 'number' && block.widthInColumns > column ) { - throw new Error(`width of block ${block.id} is greater than the column width`); + throw new Error( + `Block ${block.id} width ${block.widthInColumns} exceeds configured column width ${column}` + ); } if (block.label) { block.label = sanitizeText(block.label);