From 99644bad17cae6241b98d418a099c6ffce1b3e5d Mon Sep 17 00:00:00 2001 From: Yash Singh Date: Tue, 16 Jul 2024 21:25:59 -0700 Subject: [PATCH] fix: double space in wrapped sequence diagram messages --- packages/mermaid/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/mermaid/src/utils.ts b/packages/mermaid/src/utils.ts index 386c107389..631b6dd851 100644 --- a/packages/mermaid/src/utils.ts +++ b/packages/mermaid/src/utils.ts @@ -567,7 +567,7 @@ export const wrapLabel: (label: string, maxWidth: number, config: WrapLabelConfi if (common.lineBreakRegex.test(label)) { return label; } - const words = label.split(' '); + const words = label.split(' ').filter(Boolean); const completedLines: string[] = []; let nextLine = ''; words.forEach((word, index) => {