mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #23451] [CLOSED] fix: preserve blank lines in code blocks when submitting messages #27200
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/23451
Author: @weyseing
Created: 4/6/2026
Status: ❌ Closed
Base:
dev← Head:fix/preserve-codeblock-newlines📝 Commits (1)
743eef5fix: preserve blank lines in code blocks when submitting messages📊 Changes
1 file changed (+2 additions, -2 deletions)
View changed files
📝
src/lib/components/chat/Chat.svelte(+2 -2)📄 Description
Summary
.replaceAll('\n\n', '\n')from bothon:submithandlers inChat.sveltethat blindly stripped all double newlines from message content before passing it tosubmitHandlerSteps to Reproduce (before fix)
Root Cause
In
src/lib/components/chat/Chat.svelte, both submit handlers (lines 2954 and 2997) called:This replaced all double newlines with single newlines across the entire message — including inside code blocks where blank lines are semantically meaningful.
Fix
Pass
e.detaildirectly tosubmitHandlerwithout stripping newlines:Testing
Fixes #20302
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.