Skip to content

2 Linebreaks are converted to paragraph #11625

Closed

Description

@La-Geek

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

Activity

  1. changed the title [-]2 Linebreads are converted to paragraph[/-] [+]2 Linebreaks are converted to paragraph[/+] on Nov 8, 2018
  2. La-Geek commented on Nov 11, 2018

    @La-Geek
    Author

    The bug is fixed in WP 5.0-beta3-43883

  3. La-Geek commented on Nov 11, 2018

    @La-Geek
    Author

    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>

  4. designsimply commented on Nov 12, 2018

    @designsimply
    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?

  5. added and removed
    Needs TestingNeeds further testing to be confirmed.
    on Nov 12, 2018
  6. La-Geek commented on Nov 13, 2018

    @La-Geek
    Author

    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

  7. La-Geek commented on Nov 17, 2018

    @La-Geek
    Author

    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

  8. added
    Needs TestingNeeds further testing to be confirmed.
    and removed on Nov 30, 2018
  9. designsimply commented on Dec 1, 2018

    @designsimply
    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.

  10. added
    [Type] QuestionQuestions about the design or development of the editor.
    [Block] ClassicAffects the Classic Editor Block
    and removed
    Needs TestingNeeds further testing to be confirmed.
    on Dec 1, 2018
  11. La-Geek commented on Dec 2, 2018

    @La-Geek
    Author

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Block] ClassicAffects the Classic Editor Block[Type] QuestionQuestions about the design or development of the editor.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions