-
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
Revert from Gutenberg to Classic leaves empty tags #11160
Comments
Thanks for confirming.... which also means that the paragraph tags are in the front-end source code and inherits the |
This is sort of related to #9167 where we don't remove empty paragraph blocks on save. I'm not sure this is a bug. We can't remove empty paragraphs purposefully because we can't know whether they were added intentionally or not. We don't strip extraneous paragraph tags in the classic editor either. Some users use them for content spacing. I'm closing this as a won't fix for now, but feel free to add more comments if you have more information, or other ideas about how this could be better handled. |
Not really a good solution to ignore the issue as described; the empty paragraphs left behind on the editor switch up have bottom margins which affects the front layout/style of a page or post. The fact that these are generated by switching from Gutenberg to Classic means that they should not be generated (with the comment tag between them) in the first place. All aspects or remnants of the GB editor should be removed upon switching back to Classic. I read some of the other posts that talk about this, and it means there's a problem if elements are left behind as residue from the GB editor. |
We are not ignoring the issue, so I apologize if it comes across that way. These paragraph tags are not generated by switching from Gutenberg to Classic. These are generated by a user entering content into an editor. If you open a post in the Classic Editor and hit return 2 times, it will create 3 paragraphs with If you then activate Gutenberg and convert them to paragraph blocks, they will add the extra HTML comments to the elements as a way to hold extra data if required, but that's it. If you then deactivate Gutenberg, the HTML comments remain, but they have no effect on the appearance of the site to a visitor. We have to leave those there because there is no way to know whether removing them will result in data loss. If a user no longer wants the empty paragraphs they added, they can simply remove the empty paragraphs. Regardless of the editor in use. |
Describe the bug
Testing the editor version 4.1.1, I noticed that when going back to the Classic editor, we get tags remaining. For example:
<p><!-- wp:paragraph --></p>
With the empty paragraph tag existing in the front-end source, it applies the theme's margin that is set for paragraphs. I have not tested yet the other blocks after reverting, but this one is an important one because it effects the front-view with many empty tags.
To Reproduce
Steps to reproduce the behavior:
<p><!-- wp:paragraph --></p>
Expected behavior
Switching back to Classic, should remove all front-end tags related to blocks.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: