-
Notifications
You must be signed in to change notification settings - Fork 6
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
Add nested fragments #12
Conversation
b53e054
to
96acc13
Compare
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.
Thanks for your PR! This looks good, nice work.
Before I approve, can I ask you to update the README with:
- A mention that fragments can be nested
- Removing the "future work" item
- Adding yourself to the "Contributors" section
Addressed all of the above, and updated the README. Thanks for taking the time to review! |
I did have the thought while I was making the changes that this adds support for "nested" fragments, not necessarily "overlapping". This would required some sort of ID on the closing tag (I guess). I'm not sure if that was an important distinction |
Yes, good point — I don't think it's a hugely important distinction, and as you said, once the fragment structure is no longer tree-like it becomes necessary to annotate the closing tags. This seems like a good next step, adding a nice feature without complecting the system too much. |
Signed-off-by: Kevin Glasson <[email protected]>
Signed-off-by: Kevin Glasson <[email protected]>
Signed-off-by: Kevin Glasson <[email protected]>
Signed-off-by: Kevin Glasson <[email protected]>
- Rename error variant DoubleOpen -> UnclosedFragment. - Add clarifying comments to nested fragment test. Signed-off-by: Kevin Glasson <[email protected]>
Signed-off-by: Kevin Glasson <[email protected]>
RIght, had to fix all my signatures. It's good-to-go now! |
Would you be able to get this merged and cut a release? 🙏 |
@elidhu sorry for the wait — I've just published v0.3.0 which includes your change 🎉 |
I have added nested fragment parsing. I have not had to touch any tests except:
The original behaviour should be identical as far as the tests go.
The new behaviour can be seen in the example I added. The most notable part is the handling of nested fragment tags when outputting a fragment that has children. Nested tags are excluded as if they weren't there.
Let me know your thoughts.
Thanks!