You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We do not have currently an easy way to check that a Gutenberg block is actually empty. This would useful in case there are editor blocks which are displayed conditionally in the editor (like for example the case highlighted here : #1387 , the user could activate the setting and then deactivate it, which basically would create the additional blocks in the document). Also, we could just filter out empty blocks on parsing, to not create empty placeholders in the frontend.
One possible option would be to put a new method in the GutenbergValidator plugins, like isEmpty(), so we don't necessarily need another plugin manager. And, only if needed, we could place a utils function that would be a wrapper for instantiating the validation plugin manager and calling the isEmpty() method on a block.
Tasks:
Implement an 'isEmpty()' method for Gutenberg blocks.
Filter out empty blocks on parsing.
The text was updated successfully, but these errors were encountered:
We do not have currently an easy way to check that a Gutenberg block is actually empty. This would useful in case there are editor blocks which are displayed conditionally in the editor (like for example the case highlighted here : #1387 , the user could activate the setting and then deactivate it, which basically would create the additional blocks in the document). Also, we could just filter out empty blocks on parsing, to not create empty placeholders in the frontend.
One possible option would be to put a new method in the GutenbergValidator plugins, like isEmpty(), so we don't necessarily need another plugin manager. And, only if needed, we could place a utils function that would be a wrapper for instantiating the validation plugin manager and calling the isEmpty() method on a block.
Tasks:
The text was updated successfully, but these errors were encountered: