TurndownService was using the default br option which converts <br> tags to " \n" (two trailing spaces + newline). This caused extra spaces to appear in user prompts when editing or copying messages that contained paragraph breaks.
Changed TurndownService config to use br: '\n' to convert line breaks without adding trailing spaces.
Fixed
Extra trailing spaces being added to user prompts containing double-newlines when clicking Edit or Copy
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/20211
**Author:** [@Classic298](https://github.com/Classic298)
**Created:** 12/27/2025
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `fix-extra-space`
---
### 📝 Commits (2)
- [`0b1889f`](https://github.com/open-webui/open-webui/commit/0b1889f26ebb61bd616ecc96c87ebce2cc1ac861) Update RichTextInput.svelte
- [`ef73a8e`](https://github.com/open-webui/open-webui/commit/ef73a8e277d0d0e1f21164b27e9aa213e474c57a) Update RichTextInput.svelte
### 📊 Changes
**1 file changed** (+1 additions, -5 deletions)
<details>
<summary>View changed files</summary>
📝 `src/lib/components/common/RichTextInput.svelte` (+1 -5)
</details>
### 📄 Description
# fix: Remove trailing spaces added to prompts after sending
Fixes #20198
TurndownService was using the default `br` option which converts `<br>` tags to `" \n"` (two trailing spaces + newline). This caused extra spaces to appear in user prompts when editing or copying messages that contained paragraph breaks.
Changed TurndownService config to use `br: '\n'` to convert line breaks without adding trailing spaces.
### Fixed
- Extra trailing spaces being added to user prompts containing double-newlines when clicking Edit or Copy
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20211
Author: @Classic298
Created: 12/27/2025
Status: ❌ Closed
Base:
dev← Head:fix-extra-space📝 Commits (2)
0b1889fUpdate RichTextInput.svelteef73a8eUpdate RichTextInput.svelte📊 Changes
1 file changed (+1 additions, -5 deletions)
View changed files
📝
src/lib/components/common/RichTextInput.svelte(+1 -5)📄 Description
fix: Remove trailing spaces added to prompts after sending
Fixes #20198
TurndownService was using the default
broption which converts<br>tags to" \n"(two trailing spaces + newline). This caused extra spaces to appear in user prompts when editing or copying messages that contained paragraph breaks.Changed TurndownService config to use
br: '\n'to convert line breaks without adding trailing spaces.Fixed
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.