mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #15119] [MERGED] fix: Preserve line breaks on multi-line paste in mobile WebViews #23723
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/15119
Author: @denispol
Created: 6/18/2025
Status: ✅ Merged
Merged: 7/6/2025
Merged by: @tjbck
Base:
dev← Head:dev📝 Commits (2)
6555cf9fix: enhance paste handling for mobile WebViews and large text77a9687Merge branch 'open-webui:dev' into dev📊 Changes
1 file changed (+50 additions, -23 deletions)
View changed files
📝
src/lib/components/common/RichTextInput.svelte(+50 -23)📄 Description
Pull Request Checklist
Before submitting, make sure you've checked the following:
devbranch.PR Title Suggestion:
fix: Preserve line breaks on multi-line paste in mobile WebViewsChangelog Entry
Description
This PR fixes a bug where pasting multi-line text from clipboard suggestions on mobile WebViews (e.g., Android in-app browsers) would strip line breaks, collapsing all content onto a single line. The fix detects these specific environments and manually reconstructs the pasted content with the correct line breaks (
hardBreaknodes) using a ProseMirrorFragment, ensuring formatting is preserved without affecting other paste scenarios.Added
Changed
pasteevent handler in the rich text input component now manually creates a ProseMirrorFragmentto preserve newlines in the specific problematic environments.Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
clipboardDatafrom suggestion-based paste actions (e.g., Gboard's clipboard history).Fragment.fromArray()and areplaceWithtransaction for a robust and efficient insertion, as per ProseMirror best practices.Screenshots or Videos
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.