-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Remove empty blocks when saving a Post #9167
Comments
yo tambien estoy deacuerdo con esto. gracias! |
How do you consider a block empty? |
You know what is empty block. If it has real life uses list them here. Because I don't know them. |
So If I add a "latest posts" block and I don't touch it, it's empty? |
Listen, have no lust for verbal games. You know what I mean when I say "empty blocks". Stop playing stupid. |
I'm not playing any game here. Sorry if it was misunderstood. This was just an example, I can think of a lot of use-cases where this description of empty block doesn't work. I think it's impossible to know for sure that we can delete a block in a generic way. Plugins can extend core blocks and make them not empty by default... For these reasons, I think it's adding such behavior is impossible. |
Fair points raised here. Empty paragraphs are truly empty without characters. Image blocks are truly empty without an image set. However, the Latest Posts Block, Spacer block and a few others can be inserted and left alone without being configured. |
Not in the wildest dreams a plugin can, or may, edit my own content in a block. Specially when there is no content, and no business for a plugin there. I am talking about content, not block HTML tags, or CSS design. Empty (0) X Empty (0) = Empty (0) = Plugin is out of the picture. |
Yes, about this. But not only this. Gallery can be empty and many more. Empty quote block leaves CSS styling on front-page. All this will later cost much in expensive regex on page load. |
I don't disagree with the fact that empty blocks (especially paragraphs) would be better if removed, but technically speaking, there's nothing that can allow us to know for sure that a block is really empty.
While it's annoying to have empty paragraphs in the content, I think it's worse to lose content. |
Technically speaking the empty blocks are not even actually empty. They still contain some HTML: <p></p> |
I'm closing as invalid, let's reopen if there's any actionable item we can tackle here |
A so, you mean template, and possibly shared, blocks. Now it is legitimate and more clear. You had it nailed but for some reason decided to change it. When a User clicks outside of empty block you had it so it automatically is removed. |
The behavior you describe was causing Writing Flow issues and was not consistent. Depending on how you'd create/touch the paragraph, it was removed or not. It was removed in #8706 because the root issue for the existence of this behavior was fixed. (accidentally creating empty paragraphs when clicking the in-between line inserter) |
Block revolution is your idea, not mine. Before in TinyMce I had to use simple regex to remove empty paragraphs. Now they will be much complex and frustrating. |
Disclaimer: I am not a WordPress or Gutenberg dev. @StaggerLeee If you are adding empty paragraphs to your content, I would expect that to be your responsibility to clean up? Also, there is a CSS selector to style empty elements, so you could make empty |
It is not for me, but for beginners. Those who use WordPress in at least 85% of cases. Still do not get it. Force plugin developers to flag if they influence/force empty blocks, and what block(s). |
Well all those empty paragraphs sure do not look nice.... |
Not related to this. Inserter is now very confusing for me. You come to the last block down, and plus icon point to insert a block as second last one. Not logical for me. If whole philosophy of writing flow is to go down, down, down. Why to go back with block insert. Maybe I have some script conflict on installation. |
@StaggerLeee I agree that the sibling inserter should appear after the last block, and there are other issues that should be resolved. There are already existing issues that involve discussion about these kinds of issues:
|
I decided to go for Bug report.
Please, remove empty blocks when saving a Post. What is the point of empty blocks in a Post ?
The text was updated successfully, but these errors were encountered: