mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-03 18:17:56 -05:00
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:
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 === '') {
|
||||
|
||||
Reference in new issue
Block a user