Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Dont trigger invalid block on empty HTML content #9546
If you edit a block's HTML, delete all the content, and then deselect the block it will trigger an invalid block warning:
Note that 'empty block toolbar' also shows, and will be fixed in #9501.
This PR changes this so the block is reset to its default state and not marked as invalid. The block's 'empty block toolbar' will then also show correctly:
This matches the behaviour of the page HTML editor where if you delete a block's HTML it will revert to the default:
How has this been tested?
An additional set of tests has been added for the
This can be manually verified on different block types, and undo still works.
Types of changes
This does affect a block's HTML editor mode and so needs to be thoroughly tested. The difference should only occur when the HTML is empty, otherwise it behaves as currently.
referenced this pull request
Sep 2, 2018
Worked great on my tests, and the code changes make sense