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

Bulleted / numbered lists items should have line breaks between them in the code generated by Gutenberg #39102

Closed
nekohayo opened this issue Feb 25, 2022 · 1 comment
Labels
Needs Technical Feedback Needs testing from a developer perspective.

Comments

@nekohayo
Copy link

nekohayo commented Feb 25, 2022

Description

When writing text in a list type block, Gutenberg generates codes like this:

<!-- wp:list {"ordered":true} -->
<ol><li>blah blah</li><li>hasoetuhsantohuea oeua eouao euaoeu</li><li>banana banana banana</li></ol>
<!-- /wp:list -->

...instead of something clean and human-readable like:

<!-- wp:list {"ordered":true} -->
<ol>
    <li>blah blah</li>
    <li>hasoetuhsantohuea oeua eouao euaoeu</li>
    <li>banana banana banana</li>
</ol>
<!-- /wp:list -->

Now, you might be thinking "who cares, this is just for geeks", but imagine the example above with a dozen long sentences... it becomes a huge unreadable blob of text. There are two real issues with the compacted generated code:

  • It makes it hard to fix incorrect formatting
  • It makes it nearly impossible to review someone else's work with the diffs in the revision editor, because everything sits one one monolithic line so it's nearly impossible to tell things apart and to read it as a list like it was meant to be read

So please make Gutenberg generate readable lists code, particularly so that I can read the revision diffs of collaborators.

Step-by-step reproduction instructions

  1. Write text in a list type block
  2. Look at the resulting code, in HTML view or in the revisions comparison tool

Screenshots, screen recording, code snippet

No response

Environment info

  • Wordpress 5.9.1, with the built-in Gutenberg
  • Firefox on Fedora Linux

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@karmatosed karmatosed added the Needs Technical Feedback Needs testing from a developer perspective. label Mar 30, 2022
@ellatrix
Copy link
Member

This was fixed by #42711. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Technical Feedback Needs testing from a developer perspective.
Projects
None yet
Development

No branches or pull requests

3 participants