-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Blocks: Deprecate
isValidBlockContent
The `isValidBlockContent` function attempts to validate a block by re-generating its output but does so by ignoring any `innerBlocks` that might exist. Since blocks can change their output based on the presence or content of its inner blocks this will lead to incorrect results from the validator. `validateBlock` also makes this mistake however it is fixable since it requires passing in the block itself (fixable in another patch once there are no longer two interfaces for what appears to be the same purpose). `isValidBlockContent` doesn't pass in the block and so is fundamentally limited in being able to validate properly. This limitation also means that we can't rely on `isValidBlockContent` once we start threading source information into blocks; that is, as we improve our ability to catch and fix or preserve issues with the block markup, this function provides no way forward to incorporate those updates. After scouring through the commit logs I was unable to find a clear purpose for this second validation method and in Core it only seems to be used as a convenience function for tests. We're deprecating it in this patch because it's an exposed public interface and it's not clear if anyone relies on it.
- Loading branch information
Showing
6 changed files
with
123 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters