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

2 Linebreaks are converted to paragraph #11625

Closed
La-Geek opened this issue Nov 8, 2018 · 7 comments
Closed

2 Linebreaks are converted to paragraph #11625

La-Geek opened this issue Nov 8, 2018 · 7 comments
Labels
[Block] Classic Affects the Classic Editor Block [Type] Question Questions about the design or development of the editor.

Comments

@La-Geek
Copy link

La-Geek commented Nov 8, 2018

Describe the bug
two linebreaks are converted to paragraph

To Reproduce
Steps to reproduce the behavior:

  1. Use either block classic or block paragraph (I did not test other blocks, so also other blocks could have this behavior)
  2. write something.
  3. insert 2x <br> (two linebreaks, hit strg/control+enter/return)
  4. write something in the new line
  5. see html-code, should be -> <p> text <br><br> text </p>
  6. preview in frontend or publish and view post in frontend
  7. see source code = should be <p> text <br><br> text </p> but is <p> text </p><p> text </p>

Expected behavior
Two linebreaks instead of paragraph is sometimes essential. E. g. in block paragraph, when you use the initial letter and set a background for the block paragraph. Since the second part is converted to a paragraph it will be separated, will have no background and does not flow around the inital letter.

Desktop (please complete the following information):

  • OS: Windows 10 64bit, recent version
  • Browser Chrome recent version
@La-Geek La-Geek changed the title 2 Linebreads are converted to paragraph 2 Linebreaks are converted to paragraph Nov 8, 2018
@designsimply designsimply added the Needs Testing Needs further testing to be confirmed. label Nov 8, 2018
@La-Geek
Copy link
Author

La-Geek commented Nov 11, 2018

The bug is fixed in WP 5.0-beta3-43883

@La-Geek La-Geek closed this as completed Nov 11, 2018
@La-Geek
Copy link
Author

La-Geek commented Nov 11, 2018

Sorry, I was to fast.
It is half fixed. In Block Paragraph the two line breaks <br><br> don't change anymore (what is good)
but in Block Classic the two line breaks are converted to <p></p>

@La-Geek La-Geek reopened this Nov 11, 2018
@designsimply
Copy link
Member

I tested with WordPress 4.9.8, Gutenberg 4.3, and the Twenty Seventeen 1.7 theme using Chrome 70.0.3538.77 on macOS 10.13.6 and couldn't replicate linebreaks getting converted to paragraphs. (46s)

May I ask whether you tested with WP4.9.8 or only with WP5.0-beta? May I ask what theme you used during testing and whether you know if the theme calls any filters or actions for wpautop or if you have any other plugins installed which might be doing that?

@designsimply designsimply added [Status] Needs More Info Follow-up required in order to be actionable. and removed Needs Testing Needs further testing to be confirmed. labels Nov 12, 2018
@La-Geek
Copy link
Author

La-Geek commented Nov 13, 2018

WordPress (5.0-beta3-43891) and also with the new 5.0-beta4-43896
Theme Twenty Nineteen
No other plugins, only betatester

Insert Block Classic, write text, hit twice strg + enter, write text
switch to HTML view
switch to visuel view
switch to HTML view, it is okay = 1 paragraph with 2 br-tags
Hit publish or update button, refresh page, switch to HTML-view, now there are 2 paragraphs

linebreak

@La-Geek
Copy link
Author

La-Geek commented Nov 17, 2018

The bug persists with WP (5.0-beta5-43907), Theme Twenty Nineteen
One change: Instead of converting it to 1 paragraph, the 2 lines are converted into 2 paragraphs.

lines_converted_into_paragraphs

@designsimply designsimply added Needs Testing Needs further testing to be confirmed. and removed [Status] Needs More Info Follow-up required in order to be actionable. labels Nov 30, 2018
@designsimply
Copy link
Member

I tested with WordPress 4.9.8 with and without and Gutenberg 4.6.1 as well as with WordPress 5.0-RC2-43958.

  • In WP 4.9.8 + Gutenberg 4.6.1 with the classic block, line breaks became paragraphs on publish but did not become paragraphs when switching back and forth between "Edit in HTML" and "Edit visually".
  • In WP 5.0-RC2-43958, I found the same behavior as WP 4.9.8+ Gutenberg 4.6.1.
  • In WP 4.9.8 with the classic editor, line breaks became paragraphs when I switched from Text to Visual mode. I also noticed line breaks collapsed and became paragraphs on the front end even if I could see extra spacing in the editor.

Video: 1m28s
Tested using the classic block with WP 4.9.8 + Gutenberg 4.6.1 then the classic editor with WP 4.9.8 and no Gutenberg. Twenty Fifteen theme.

To be honest, I am not 100% sure what the expected behavior is supposed to be so I will add the [Type] Question label.

@designsimply designsimply added [Type] Question Questions about the design or development of the editor. [Block] Classic Affects the Classic Editor Block and removed Needs Testing Needs further testing to be confirmed. labels Dec 1, 2018
@La-Geek
Copy link
Author

La-Geek commented Dec 2, 2018

you are right. No idea, if this had another behavior in prior versions of WordPress (<4.9.8). However, also in WP without Gutenberg the linebreaks are converted to paragraph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Classic Affects the Classic Editor Block [Type] Question Questions about the design or development of the editor.
Projects
None yet
Development

No branches or pull requests

2 participants