sergey
sergey copied to clipboard
Nested templates: first closing tag closes parent instead of child
Issue
Nesting templates causes the parent to close on the closing tag of the child template.
Expected behavior
The last newly opened <sergey-template> tag should close at the subsequent </sergey-template>.
How to reproduce
The </sergey-template> tag after 'article' closes the name="main" template tag instead of the expected name="classes" template tag.
<sergey-template name="main">
<sergey-import src="grid-item">
<sergey-template name="classes">article</sergey-template>
<sergey-template name="content">
Test
</sergey-template>
</sergey-import>
< more html />
<sergey-template/>
@Imable thanks for the report - I'll investigate the issue when I get a second!
https://regex101.com/r/8AQwse/1 (for my reference)
@trys what about using jsdom instead of regular expressions?
I've created a POC (proof of concept) that really simplifies the mathing of sergey-* tags and reduces the while loops.
Also, i've tried to run this error and seems to be solved.
What do you think @trys? Can I work on this?
@guesant So sorry for the delay, there's an awful lot going on in my life right now. jsdom or parse5 was exactly the route I was planning on going down to properly fix this, so thank you so much for the proof of concept! I'm so grateful!
I can't guarantee how much time I can commit to this project over the next month or so, but please feel free to keep working on this and I'll try and find some time to get involved, review, test and suggest! 😄