From 238e1a40f734eb9f00272aac7ab3aaf29f499d0d Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:11:26 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- packages/mermaid/src/rendering-util/splitText.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mermaid/src/rendering-util/splitText.ts b/packages/mermaid/src/rendering-util/splitText.ts index e5dd33f1de..147ce83717 100644 --- a/packages/mermaid/src/rendering-util/splitText.ts +++ b/packages/mermaid/src/rendering-util/splitText.ts @@ -23,7 +23,7 @@ export function splitLineToWords(text: string): string[] { (s) => s.segment // Change: Locale-aware word splitting. ); } - + // Fallback: Split by spaces, adding back spaces manually. const words = text.split(' '); const wordsWithSpaces = words.flatMap((s) => [s, ' ']).filter((s) => s); @@ -62,7 +62,7 @@ function splitWordToFitWidthRecursion( } const [nextChar, ...rest] = remainingChars; const newWord = [...usedChars, nextChar]; - + // Check if the word with the next character still fits. if (checkFit([{ content: newWord.join(''), type }])) { return splitWordToFitWidthRecursion(checkFit, newWord, rest, type); // Continue recursion. @@ -122,7 +122,7 @@ function splitLineToFitWidthRecursion( const nextWord: MarkdownWord = words.shift() ?? { content: ' ', type: 'normal' }; const lineWithNextWord: MarkdownLine = [...newLine]; - + // Handle spaces between words. if (joiner !== '') { lineWithNextWord.push({ content: joiner, type: 'normal' });