the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
977 stars 114 forks source link

Multiple line breaks are not displayed #1666

Closed jnloos closed 1 month ago

jnloos commented 1 month ago

This issue relates to the Nextcloud plugin.

Since the last update, multiple line breaks are no longer displayed for recipients. Instead, they are shown as one. Although line breaks are displayed properly in the visual editor, they are "removed" as soon as the mail is sent. If the mail is opened again after it has been sent, the line breaks are also no longer displayed.

I think it has something to do with the fact that a new div is generated with every line break.

Steps to reproduce the behavior:

  1. Write an email
  2. Divide sections with multiple linebreaks
  3. Send and reopen the email

Email preview in the visual editor: visual_editor

Message actually sent: sent_email

Email in the code editor: code_editor

the-djmaze commented 1 month ago

Confirmed. The issue happens one way or the other. In the past the line endings were duplicated and now they are gone.

The issue is browser content-edit. There are 2 types of "Enter". When hitting "Enter" The browser default is <p> and that makes paragraphs with "empty line" (margin) between the lines. You need to use "Shift+Enter" for a <br>.

Squire handles it different as it always makes <div> blocks. This is easier regarding the default HTML rules defined by W3C and WHATWG. As they have semantic differences:

So the following are allowed:

<div><div></div></div>
<div><p></p></div>
<div><blockquote></blockquote></div>

But these NOT:

<p><div></div></p>
<p><table></table></p>
<p><blockquote></blockquote></p>

I will see if i can figure out a way to keep <div></br></div> or convert to <p> where allowed.

the-djmaze commented 1 month ago

Also see #1389

chsleemsi commented 3 weeks ago

Sorry that it seems the problem persist. May I know if there is any solution?

jnloos commented 2 weeks ago

Sorry that it seems the problem persist. May I know if there is any solution?

Works fine since release v2.37.2.