-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parser: Add "void" block signature #1134
Conversation
I like this for the terseness, thanks for the quick addition. |
The syntax and code seem fine 👍 This PR should also update the serializer to use this format if a block has no content, and one or more tests should be added. |
Sometimes a block doesn't need anything inside of the block comment tags as children. One example of this is the traditional "more tag," which only needs to indicate position. These changes introduce a new syntax element, the "void block," borrowing from the HTML5 nomenclature for HTML void elements. In this new element, there are no children. Since nothing changes on the JavaScript size this could be considered an optimization whereby any block with no children serializes to a self-closing block comment tag, saving some space and improving readability of the `post_content`.
a9334ad
to
af617a2
Compare
I'm having real trouble here making the tests work for this and I'm also experiencing an odd problem on save. Problem with tests
Problem with save behavior
Not sure how to move forward with this until I can get some help on these tests. Manual testing seems to work as expected. |
Also update the full-content fixtures with the resulting changes.
5ebe561 fixes the tests. This change really should have been part of #947 (and tests for the bugs fixed there should have been added there). The intent and functionality of these tests are documented here. Most of the test fixture changes necessitated by using the PEG parser look OK, one that I'm not sure about is adding |
By "this change" I mean the specific change to use the PEG parser in the test suite as well. |
Resolves #1085
Sometimes a block doesn't need anything inside of the block comment tags
as children. One example of this is the traditional "more tag," which
only needs to indicate position.
These changes introduce a new syntax element, the "void block,"
borrowing from the HTML5 nomenclature for HTML void elements.
In this new element, there are no children.
Since nothing changes on the JavaScript size this could be considered an
optimization whereby any block with no children serializes to a
self-closing block comment tag, saving some space and improving
readability of the
post_content
.