-
Notifications
You must be signed in to change notification settings - Fork 9
SSR: Add basic directive processor #169
SSR: Add basic directive processor #169
Conversation
9f0c237 to
bbc790f
Compare
The directive processor builds on the HTML Tag Processor to provide additional functionality, assuming normative markup generated from React, assuming that all tag directives contain a balanced closer. This will break in practice, and is probably entirely wrong as-is. The purpose of this commit is to introduce the idea and explore using the code to get a feel for whether it will work.
This reverts commit bbc790f.
5457d8b to
054c579
Compare
| @@ -0,0 +1,155 @@ | |||
| <?php | |||
|
|
|||
| class WP_Directive_Processor extends WP_HTML_Tag_Processor { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#156 also had some more directive-specific logic (such as a next_directive method) that I removed. The reason is that it’ll need some more work where we’d need to move some of the logic that’s currently in wp_process_directives into this class. This isn’t currently a priority, so I’ve opted to defer it.
As a consequence however, WP_Directive_Processor doesn’t have any directive-specific code at all — it’s really more of a WP_HTML_Tag_Processor-derived class that allows finding a balanced closing tag, and getting/setting inner HTML. It might thus be worth considering renaming that class.
luisherranz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me, Bernie! 🎉
|
Thanks you very much, Luis! 🎉 |
WIP. This is basically a copy of @dmsnell's #158 for now, which I've forked per this comment.
I've removed @adamziel's
get_outer_htmlandset_outer_htmlcommit for now since we might not actually need it 😊