fix(composer): Fix paragraph breaks getting lost on paste and sending#12915
Open
jancborchardt wants to merge 1 commit into
Open
fix(composer): Fix paragraph breaks getting lost on paste and sending#12915jancborchardt wants to merge 1 commit into
jancborchardt wants to merge 1 commit into
Conversation
AI-assisted: GitHub Copilot (Claude Sonnet 4.6) Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com>
| } | ||
|
|
||
| // Show empty lines correctly in composer | ||
| :deep(p + p) { |
Member
There was a problem hiding this comment.
this will only fix it in the editor, not for the sent email, no?
Member
Author
There was a problem hiding this comment.
Yeah this part specifically is to fix the appearance when pasted into the composer (both plaintext and HTML), as without it it looks like the "before" pics. Just verified and tested again, removing that line specifically.
I started with only that CSS part, but that wasn’t enough to fix the issue. So the rest is to make it actually work during the mail sending process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the mail composer (when writing a new mail), pasting plain text content from elsewhere like a local text editor or a website doesn’t preserve empty lines inbetween lines of text or paragraphs. Currently they are removed on pasting, but of course they should be kept.
This happens in both plain-text composing as well as when using formatting.
As an example, this text:
Is being pasted wrongly and appears like this:
Interestingly, when copying the block of text back from the composer into the text editor, it looks fine. So it seems to have been partly a formatting/CSS issue only but the structure was correctly preserved.
Screenshots of:
<p>elements render with visible spacing:src/util/text.js: Plain-text sending fix Added a customParagraph formatter for
<p>that emits two line breaks (\n\n) instead of one, so paragraph breaks are preserved in sent plain-text emails.lib/Service/MimeMessage.php: HTML→plain-text conversion fix Removed htmlToTextCallback, which was intentionally overriding Horde's default to collapse
<p>to \n. Horde's default (\n\n) is now used.src/ckeditor/mail/MailPlugin.js: HTML mail fix (deleted) This plugin injected
style="margin:0;"onto every<p>in the serialized HTML, which overrode email client rendering and collapsed paragraph spacing in received HTML emails. Deleted entirely.Tests updated
<p>producing \n\n<p>AI-assisted: GitHub Copilot (Claude Sonnet 4.6)