mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-05 18:38:17 -05:00
[GH-ISSUE #20198] issue: After sending a prompt, extra spaces are added #19121
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?
Originally created by @bgreene2 on GitHub (Dec 27, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20198
Check Existing Issues
Installation Method
Pip Install
Open WebUI Version
v0.6.43
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04 (Host)
Browser (if applicable)
Chrome 143.0.7499.170 (Windows 11), Firefox 146.0.1 (Android)
Confirmation
README.md.Expected Behavior
In the Chat interface:
Actual Behavior
In the Chat interface, at some point between when you send the prompt and when you click Edit or Copy, any double-newline (\n\n) has double spaces ( ) added before each newline.
Example:
Original prompt:
After clicking Edit or Copy:
Note the extra " " at the end of each line but the last.
Steps to Reproduce
Logs & Screenshots
Prompt before clicking send:
Prompt after clicking send, before clicking edit. I've highlighted the text with the mouse. Note there are no extra spaces visible:
Prompt after clicking edit. I've highlighted the text with the mouse. Note the extra spaces:
Prompt after clicking edit. I've highlighted only the extra spaces at the end of one of the lines, to make it more clear:
Additional Information
@owui-terminator[bot] commented on GitHub (Dec 27, 2025):
🔍 Similar Issues Found
I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:
#20155 issue:
by dhaern • Dec 24, 2025 •
bug#20107 issue:
by mengdeer589 • Dec 22, 2025 •
bug#20196 issue:
by dhaern • Dec 27, 2025 •
bug#19877 issue:
by dotmobo • Dec 11, 2025 •
bug#19861 issue:
by QuitHub • Dec 10, 2025 •
bugShow 5 more related issues
#19777 issue:
by Yaute7 • Dec 05, 2025 •
bug#20019 issue:
by j63440490 • Dec 17, 2025 •
bug#20092 issue:
by VideoRyan • Dec 22, 2025 •
bug#18161 issue: v0.6.33 - Previous reply not sent with prompt
by frenzybiscuit • Oct 08, 2025 •
bug#19078 issue: Inconsistent default system prompt loading
by abcbarryn • Nov 10, 2025 •
bug💡 Tips:
This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
@bgreene2 commented on GitHub (Dec 27, 2025):
None of the issues found by the owui-terminator bot match this issue.
@dhaern commented on GitHub (Dec 27, 2025):
I never saw a single issue found by the owui-terminator bot match lol, worse bot ever
@frenzybiscuit commented on GitHub (Dec 27, 2025):
Cannot replicate on the latest .43 using desktop firefox.
@silentoplayz commented on GitHub (Dec 27, 2025):
I am able to reproduce this issue on the latest
devcommit using Mozilla Firefox Snap for Ubuntu v146.0.1 (64-bit).Prompt I copy/pasted:
After clicking
EditorCopybuttons to see the text:Screenshots should be sufficient enough to prove this. Thanks for the report @bgreene2.
@Classic298 commented on GitHub (Dec 27, 2025):
To be fair, on stuff that's brand new, the bot obviously won't find anything like here.
@Classic298 commented on GitHub (Jan 1, 2026):
yeah i wasted hours trying to fix this again, continuing my failed attempts from 5 days ago
i dont know how to fix this.
it seems the double spaces are needed, otherwise you get compatibility issues with github markdown rendering
there is a way to fix/remove the double new spaces of course, but then you introduce missing newlines as a new issue and fixing that is a whole different issue with richtextinput
@rgaricano commented on GitHub (Jan 3, 2026):
Even when Rich Text Input is turned off, the text still goes through HTML-to-markdown conversion that adds spaces around newlines. In
RichTextInput.svelte, theonValueChangefunction processes all text throughturndownServiceregardless of the rich text setting.6f1486ffd0/src/lib/components/common/RichTextInput.svelte (L1098-L1110)Solutions:
Modify
RichTextInput.svelteto respect therichTextsetting inonValueChange:This would bypass the space-adding turndown conversion when rich text is disabled.
Update the turndown service configuration to not add spaces around newlines:
Add a property to store the original unprocessed text:
Then use originalContent when editing or copying messages in
6f1486ffd0/src/lib/components/chat/Messages/UserMessage.svelte (L276-L280)and in6f1486ffd0/src/lib/components/chat/Messages/ResponseMessage.svelte (L707-L711)Remove the \n\n to \n conversion in the submit handlers:
In
6f1486ffd0/src/lib/components/chat/Chat.svelte (L2546)& in6f1486ffd0/src/lib/components/chat/Chat.svelte (L2595)This would preserve the original double newlines through the entire flow
NOTE: Solution 1 is the most targeted fix as it addresses the core issue: the HTML-to-markdown conversion happening when it shouldn't. It preserves the existing rich text functionality while fixing the plain text mode behavior.