Composing plain text introduces NBSP characters
Open
@kesselb is already working on this.
Since May 20, 2025.
0. to triage
bug
- Dominant language
- JavaScript
- Stars
- 1k
- Forks
- 348
- Avg merge
- 12h 28m
- Merged PRs (30d)
- 91
Description
Steps to reproduce
- Start New message, leave it in plain-text (no formatting toolbar).
- Write email with some leading spaces (indented lines) or multiple spaces in the middle of the line.
- Send the mail to yourself.
- Open the mail when delivered and download the EML file (or use View source, but that one introduces empty lines when copy/paste is used) - the steps are: ... on the message, ... More actions, Download message
- Check the content, it is not intended plain text because it placed sneaky NBSP characters (see below).
Expected behavior
Plain text mail should preserve all the characters as-is, spaces as spaces, not introduce NBSP to "preserve" formatting even in HTML output. This solves the plaintext only from Nextcloud mail for Nextcloud mail viewer, but it does not preserve plaintext formatting for mails sent from elsewhere.
Actual behavior
The mail content produces something like this:
Content-Type: text/plain; charset=utf-8
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
one
=C2=A0two =C2=A0 here
=C2=A0 =C2=A0three
It is quoted-printable for no good reason, because some spaces were replaced with =C2=A0 during the message creation.
Mail app version
4.2.6
Nextcloud version
31.0.1
Mailserver or service
Zimbra 8.x
Operating system
Ubuntu 24.04.2 LTS
PHP engine version
PHP 8.3
Nextcloud memory caching
No response
Web server
Apache (supported)
Database
PostgreSQL
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.