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
Block API: Consider encoding-normalized text as equivalent #11771
This pull request seeks to improve the block validation step to allow more leniency for effectively equivalent text encoded in varying forms.
The changes here were authored in such a way where there may be a slight performance benefit over master, both in a reduction of bundle size (an approximate 18% reduction gzipped on the
In the process of implementing further text normalization here, it was discovered that the underlying
Verify that block invalidation is not triggered by encoding variations.
For example, inserting the following HTML as the contents of a post (in Text Mode, Classic Editor Text tab, or directly in the database) should not be presented as an invalid block when next viewing the Visual Mode of the editor:
<!-- wp:paragraph --> <p>This works. 😅</p> <!-- /wp:paragraph -->
The current test failures are legitimate. In disabling
I'll need to think more on how best to address this, because the normalizations aren't strictly the same for text and attributes. Further, we have a few specific handlers on attribute value equivalence (e.g.
One option may be to switch back to relying on