Skip to content

Fix: Preserve newlines in formatted text messages#161

Open
Quffik wants to merge 1 commit into
ExteraApp:mainfrom
Quffik:Fix-newline
Open

Fix: Preserve newlines in formatted text messages#161
Quffik wants to merge 1 commit into
ExteraApp:mainfrom
Quffik:Fix-newline

Conversation

@Quffik

@Quffik Quffik commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What has been changed:
Updated the regular expression used for text normalization to prevent it from replacing newline (\n) characters with standard spaces.

Why it has been changed:
To fix a bug where formatted messages lost all line breaks and collapsed into a single line of text, which severely broke text readability and layout.

How it has been changed:
Replaced the aggressive RegExp(r'\s+') pattern, which matches all whitespace including newlines, with RegExp(r'[ \t\r\f]+'). This explicitly limits white space normalization to tabs and horizontal spaces, preserving \n intact.

Pull Request has been tested on:

  • Android
  • iOS
  • Browser (Chromium based)
  • Browser (Firefox based)
  • Browser (WebKit based)
  • Desktop Linux
  • Desktop Windows
  • Desktop macOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant