-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Rendering empty paragraph blocks #15918
Comments
Hi @edirpedro - thanks for creating the issue. Are you specifically talking about an empty paragraph at the end of a post? It's a bit hard to tell, because in your screen capture it's an empty paragraph between blocks. I wasn't able to reproduce it in my editor. I tried:
Result: no unexpected blocks were added. If you can provide some specific steps that others can follow to reproduce the issue that would be really helpful. Thanks. |
Another way is just starting a document and hit enter to add new paragraphs. The empty tag Results in:
In my opinion, only a paragraph with some space |
some people use empty paragraphs for spacing between blocks of text, removing them all together might cause problems & compatibility issues a fix you can implement on your side is to hide empty paragraphs all together p:empty {
display: none;
} or hide the last one if you wish p:empty:last-of-type {
display: none;
} |
I was thinking about and first, using empty paragraphs is how text editors works and how people usually write when they need some space in the document, second, for web development this can be intended as a bug because empty tags is not a good practice. As a developer I would like to see this "feature" removed, but i'm not sure how this would affect other people who will write content. But Gutenberg doesn't work exactly like a text editor because of the block elements used to create content, the interface is not clean like a text editor is, so empty paragraphs does not seems to fit good on it. In my recorded video you can see that they break good rendering even on the Gutenberg side. There is a Spacer block so I think that this element should be the right one to create spaces inside Gutenberg and not empty blocks. |
maybe we can find a way to keep compatibility & encourage the use of the Spacer Block |
Has there been any movement on this issue? If there's an empty block awaiting text (for admin convenience) it should either be deletable in back-end or should not render an empty element on the front-end. Visual element spacing should be the purview of style / css and not empty paragraphs. |
Let's close this as a duplicate to #10051 to keep discussions focused. |
The editor is rendering empty paragraph blocks and this always cause some issues in the front-end, placing empty spaces on screen that breaks the design and the client can't understand what is happening and how to fix it.
It's hard to fix too because the paragraphs can appear on the editor with just a click or using the arrow keys to navigate through the blocks. It's easy to create those empty tags when editing some content. I can understand the way the editor add this block automatically, but if empty, the editor shouldn't save them without some content, at least a space to indicate that it was really intentional.
Moving between blocks using arrow keys creates empty paragraph blocks
They are saved and rendered on the front-end
Testing on WordPress 5.2.1
The text was updated successfully, but these errors were encountered: