mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-06 08:18:53 +00:00
fix: preserve blank lines in code blocks when submitting messages
The `on:submit` handlers in Chat.svelte called `.replaceAll('\n\n', '\n')`
on the entire message content before passing it to `submitHandler`. This
blindly collapsed all double newlines into single newlines, which stripped
blank lines inside code blocks — destroying intentional formatting.
Removed the `.replaceAll('\n\n', '\n')` from both submit handlers so that
message content is passed through unchanged.
Fixes #20302
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
c40ea7f29d
commit
743eef55a5
1 changed files with 2 additions and 2 deletions
|
|
@ -2951,7 +2951,7 @@
|
|||
if (e.detail || files.length > 0) {
|
||||
await tick();
|
||||
|
||||
submitHandler(e.detail.replaceAll('\n\n', '\n'));
|
||||
submitHandler(e.detail);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
|
@ -2994,7 +2994,7 @@
|
|||
clearDraft();
|
||||
if (e.detail || files.length > 0) {
|
||||
await tick();
|
||||
submitHandler(e.detail.replaceAll('\n\n', '\n'));
|
||||
submitHandler(e.detail);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue