verso
verso copied to clipboard
Add nested fragments
I have added nested fragment parsing. I have not had to touch any tests except:
- Removing the "double open" test as it is no longer an error.
- Adding a "halt while open" test that I noticed was missing.
- Adding a "nested fragment" test.
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!
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.
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 🎉