Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple line breaks are not displayed #1666

Closed
jnloos opened this issue Jul 14, 2024 · 4 comments
Closed

Multiple line breaks are not displayed #1666

jnloos opened this issue Jul 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@jnloos
Copy link

jnloos commented Jul 14, 2024

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

  • Browser: Firefox and Chrome
  • SnappyMail Version: 2.36.4 (Nextcloud plugin version)
  • Mode: nextcloud
@the-djmaze the-djmaze added the bug Something isn't working label Jul 14, 2024
@the-djmaze
Copy link
Owner

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:

  • <div> element is designed to describe a container of data
  • <p> element is designed to describe a paragraph of content

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
Copy link
Owner

Also see #1389

@chsleemsi
Copy link

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

@jnloos
Copy link
Author

jnloos commented Aug 15, 2024

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

Works fine since release v2.37.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants