5 ms·
I'm still really hoping for Jinja2/Django template support: https://github.com/prettier/prettier/issues/5754 https://github.com/prettier/prettier/issues/5754 /
by simonw 7y ago
I'm still really hoping for Jinja2/Django template support: https://github.com/prettier/prettier/issues/5754 https://github.com/prettier/prettier/issues/5754 / https://github.com/prettier/prettier/issues/5581 https://github.com/prettier/prettier/issues/5581
- gkoberger 7y agoPrettier was originally created by James Long, who also created Nunchucks (which is the Node port of Jinja2, since we were all familiar with Jinja2 at Mozilla). I don't really have a point since he's not involved in either anymore; just thought it was interesting!
- j-f1 7y agoThis is actually quite challenging because the template language allows you to insert template tags into any location in the template file, and while people usually put them in reasonable places, there’s no guarantee. For example, someone could do a thing like `{{ less_than }}div class="foo">abc</div>` and that would be totally valid but a nightmare to parse. That’s different from a more structured template-style language like JSX, where there are only a few valid places to embed JS expressions so it isn’t too challenging to make them all look good.