fix(composer): Fix paragraph breaks getting lost on paste and sending#12915
fix(composer): Fix paragraph breaks getting lost on paste and sending#12915jancborchardt wants to merge 1 commit into
Conversation
| } | ||
|
|
||
| // Show empty lines correctly in composer | ||
| :deep(p + p) { |
There was a problem hiding this comment.
this will only fix it in the editor, not for the sent email, no?
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.
jancborchardt
left a comment
There was a problem hiding this comment.
@ChristophWurst so any adjustments needed or what do you think?
|
I need time to test. I'll have a look soon. |
|
Conflicts :s |
24e75b2 to
335f832
Compare
jancborchardt
left a comment
There was a problem hiding this comment.
@ChristophWurst was a simple conflict, fixed. :)
AI-assisted: GitHub Copilot (Claude Sonnet 4.6) Signed-off-by: Jan C. Borchardt <925062+jancborchardt@users.noreply.github.com>
335f832 to
65771da
Compare
jancborchardt
left a comment
There was a problem hiding this comment.
Also fixed the linter error by removing the now unused use DOMNode; from lib/Service/MimeMessage.php
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)