Open
Description
A plugin can use the blocks.getSaveElement
to modify the saved output of a Gutenberg core block. I started documenting this here: #8470 (review)
For instance, I may want to write a plugin which adds a data-pin-description
attribute to an Image Block:
<!-- wp:image {"id":33863} -->
<figure class="wp-block-image"><img data-pin-description="My Pinterest description" src="http://tastyrecipes.test/wp-content/uploads/2018/03/food-dinner-pasta-broccoli.jpg" alt="" class="wp-image-33863" /></figure>
<!-- /wp:image -->
However, if the plugin is deactivated after the user adds a Pinterest Description to their Image Block, the Image Block, the block will enter into an invalid, crashed state.
The Classic Editor permits manipulation of any HTML5 element, in accordance to the entire spec. It would be ideal of Gutenberg permitted the same: #6878 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Issues or PRs that impact backwards compatabilityAPI that allows to express the block paradigm.Block transforms from one block to anotherOverall functionality of blocksThe ability to extend blocks or the editing experienceAnything that impacts the experience of managing mediaA suggestion for improvement.