Conversation
blocks/api/post.pegjs
Outdated
| Token | ||
| = Block_Void | ||
| Block | ||
| = Block_Empty |
There was a problem hiding this comment.
It’s worth considering the context in which void was chosen as a name. It borrows from the HTML spec which specifies certain tags as void and those are not allowed to have a closing tag - hr, img, br, etc... in Gutenberg it’s optional the distinction between empty and void but the intention was to convey void elements, not to present an optimization for empty elements
dmsnell
left a comment
There was a problem hiding this comment.
I should clarify what I was saying about Void. I approve these changes though I think it may still be worth considering not changing Void to Empty because they carry different semantic nuances.
Make your choice; I support this either way.
* Rename Token to Block * Rename Block_Void to Block_Empty * Port WS+ to __ * Update PHP parser
970fa74 to
446b67d
Compare
|
Thanks for the review and confidence, Dennis. Your comment on void/empty makes a lot of sense. I'll keep |
|
The point is that void blocks aren’t empty blocks but thy are blocks that cannot contain content. Maybe we muddy that in our parser/serializer. If it ends up that actually we use it as a shorthand then we may actually want to rename it. Nice work in any case! |
* Rename Token to Block * Rename Block_Void to Block_Empty * Port WS+ to __ * Update PHP parser
Description
Spin-off from #6116.
Grammar changes:
TokentoBlockBlock_VoidtoBlock_EmptyWS+to__, merging together white-space rulesHow Has This Been Tested?
Screenshots (jpeg or gifs if applicable):
Types of changes
Checklist: