mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #21518] [CLOSED] fix: preserve newlines in textarea prompt variables on Windows #64971
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/21518
Author: @eren-karakus0
Created: 2/17/2026
Status: ❌ Closed
Base:
dev← Head:fix/windows-textarea-newlines📝 Commits (1)
130eb1efix: preserve newlines in textarea prompt variables on Windows📊 Changes
2 files changed (+25 additions, -2 deletions)
View changed files
📝
src/lib/components/chat/MessageInput/InputVariablesModal.svelte(+8 -1)📝
src/lib/components/common/RichTextInput.svelte(+17 -1)📄 Description
Summary
Fixes textarea input variables losing line breaks after message submission on Windows.
Problem
When users paste or type multi-line text into a textarea prompt variable on Windows:
Root cause: two issues working together:
\r\n) line endings which were not normalizedschema.text()creates plain text nodes that discard newline characters — they need to be represented ashardBreaknodesSolution
InputVariablesModal.svelte: Normalize Windows CRLF (\r\n) to LF (\n) before passing variable values to the editor.RichTextInput.svelte: InreplaceVariables(), split replacement text on newlines and create proper ProseMirrorhardBreaknodes between textsegments instead of inserting raw newline characters.
Closes #21447
Changelog Entry
Description
replaceVariables()andInputVariablesModalFixed
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.