thibaudcolas / curlylint

Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid
https://www.curlylint.org/
MIT License
236 stars 25 forks source link

WIP: Added a few ugly testcases #138

Open JensHeinrich opened 2 years ago

JensHeinrich commented 2 years ago

Only added tests right now

includes #74

JensHeinrich commented 2 years ago

The problem seems to be the interweaving in the AST; technically there are two AST here I think:

JensHeinrich commented 2 years ago

So I just had an weird idea: Maybe a structure representing an construct yielding an opening tag and a structure yielding a closing tag could be created to accomodate the content of the those conditional blocks then the optional block could use a list of tuples of condition and opening tag and a list of tuples of condition and closing tag to define this having these lists a closing tag like in test_different_container_openings(self) could probably be implemented too