Reputation: 935
I've wondered if there is a way to infinitly nest html elements using a pug iteration. The only thing I thought of was an iteration counter dependent indentation for the markup. But I'm not even sure if this is a possible thing. Does somebody know if there is a way to do that?
Heres a little example for clarification:
The following pug markup
div
div
div
div
div
would lead to the following html
<div>
<div>
<div>
<div>
<div>
</div>
</div>
</div>
</div>
</div>
That is what I am trying to achieve using an iteration or something in pug to keep the code small, even if we had 10000 elements nested like this.
Best regards
Upvotes: 1
Views: 122