Hacker Newsnew | past | comments | ask | show | jobs | submitlogin



This 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.


Prettier 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!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: