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.
This commit is contained in:
G30 authored and GitHub committed 2026-12-01 01:43:05 +04:00
1 parent b1c40acbb1
commit fc3bb0c6bd
1 file changed
+3
@@ -450,6 +450,7 @@
.replace(/<p><\/p>/g, '<br/>')
.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 === '') {