forked from WordPress/gutenberg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In this patch we're opening up a new avenue for allowing nested blocks in the data structure. For each block: - Nested blocks appear as `innerBlocks` as a sequential list - The contained HTML _without_ the nested blocks appear as a string property `innerHtml` which replaces `rawContent` Also: - Remove `WP_` prefix on grammar terms - not needed - was there from the earliest iterations where different parts were prefixed by which spec they implemented, such as HTML_, URL_, etc... Regenerates fixtures based on updated parser Disable eslint for line so tests will run Fix rebase issue Update based on PR feedback I'm breaking my own rules here by introducing more code into the parser but I'm also not sure how we can escape this without placing higher demands on some post-processing after the parse. Changes: - Do away with non-supported language features - Abstract `joinBlocks( pre, tokens, post )` into a function basically just need to join non-empty items into a flat list Tiny fix and big header comment Added comment to start of rules Actually return blocks from peg_join_blocks() Minor adjustments to parser to preserve existing behavior Update parser and fix bug in updates When the `Balanced_Block` was rebuilt to be defined as a starting block, some number of tokens and non-closing HTML, finished by a closing block, I used a `+` to indicate that we needed at least _some_ content inside of the block to be valid. In some regards this is true because empty blocks should be void blocks. On the other hand, it's very likely that we'll receive empty non-void blocks in practice and the parser should not invalidate one because it has chosen the wrong syntax. This update replaces the `+` with a `*` such that we can have empty blocks and they will be treated as normal. Remove unnecessary semicolon Blocks: Access block content by innerHTML Parser: Drop callable type hint Type hint supported only in PHP 5.4+, above support level. Only use is in call_user_func, supportable with expected string callable input prior to 5.4
- Loading branch information
Showing
71 changed files
with
904 additions
and
492 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
Oops, something went wrong.