From 0af77a3c2caedd54da9540abd3006b80a81a2f3d Mon Sep 17 00:00:00 2001 From: Hans Blankenhaus Date: Tue, 19 Sep 2023 17:57:59 +0200 Subject: [PATCH] optional auto wrapping for markdownToLines --- packages/mermaid/src/rendering-util/handle-markdown-text.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/mermaid/src/rendering-util/handle-markdown-text.ts b/packages/mermaid/src/rendering-util/handle-markdown-text.ts index 160be86da..572b28c99 100644 --- a/packages/mermaid/src/rendering-util/handle-markdown-text.ts +++ b/packages/mermaid/src/rendering-util/handle-markdown-text.ts @@ -9,10 +9,16 @@ import { getConfig } from '../config.js'; * @returns processed markdown */ function preprocessMarkdown(markdown: string): string { + const markdownAutoWrap = getConfig().markdownAutoWrap; // Replace multiple newlines with a single newline const withoutMultipleNewlines = markdown.replace(/\n{2,}/g, '\n'); // Remove extra spaces at the beginning of each line const withoutExtraSpaces = dedent(withoutMultipleNewlines); + /* + if (markdownAutoWrap === false) { + return withoutExtraSpaces.replace(/ /g, ' '); + } + */ return withoutExtraSpaces; }