fix: fix review comments

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
darshanr0107
2025-07-16 13:11:44 +05:30
parent 71b04f93b0
commit ac976245ad
2 changed files with 4 additions and 2 deletions

View File

@@ -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.

View File

@@ -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);