diff --git a/src/lib/components/common/RichTextInput.svelte b/src/lib/components/common/RichTextInput.svelte index 5f8bd488ae..6102fcc178 100644 --- a/src/lib/components/common/RichTextInput.svelte +++ b/src/lib/components/common/RichTextInput.svelte @@ -450,6 +450,7 @@ .replace(/

<\/p>/g, '
') .replace(/ {2,}/g, (m) => m.replace(/ /g, '\u00a0')) ) + .replace(/^ {2}$/gm, '') .replace(/\u00a0/g, ' '); } else { mdValue = turndownService @@ -462,6 +463,7 @@ // Replace tabs with non-breaking spaces (preserve indentation) .replace(/\t/g, '\u00a0\u00a0\u00a0\u00a0') // 1 tab = 4 spaces ) + .replace(/^ {2}$/gm, '') // Convert non-breaking spaces back to regular spaces for markdown .replace(/\u00a0/g, ' '); } @@ -1563,6 +1565,7 @@ (m) => m.replace(/ /g, '\u00a0') ) ) + .replace(/^ {2}$/gm, '') .replace(/\u00a0/g, ' '); if (value === '') {