From fc3bb0c6bdc11c752848215670eacbc534e1059a Mon Sep 17 00:00:00 2001 From: G30 <50341825+silentoplayz@users.noreply.github.com> Date: Mon, 30 Nov 2026 16:43:05 -0500 Subject: [PATCH] fix: blank lines in a sent message no longer carry two spaces (#35355) * fix: blank lines in a sent message no longer carry two spaces * fix: keep blank lines typed with Shift+Enter in comments The comment box rebuilds its Markdown in onValueChange and reloads the editor when that differs from the serialized value. Clear the two-space line there too, so a second hard break no longer makes them differ and drop the blank line. --- src/lib/components/common/RichTextInput.svelte | 3 +++ 1 file changed, 3 insertions(+) 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 === '') {