Hacker News new | ask | show | jobs
by tomjakubowski 1386 days ago
One great benefit of a good template language is automatic escaping (e.g. within HTML attributes or tags), which you won't get from format strings.
1 comments

Is that important in a static site generator?

In a server-rendered site you have to worry about injection attacks, but that's not really relevant when you're statically generating a site from content that's fully under your control

But then you'll need to watch for `<script>` in examples of your articles, so you dont need to write it as `&lt;script&gt;`. And how you are going to get the second in your blog? How do you like to write `&amp;lt;script&amp;gt;`?

It is very convenient to have an automatic escaping of everything.

Depends on the site I guess. My actual blog content is written in Markdown, which already handles escaping stuff between backticks, and that's the only place I'm likely to run into that sort of thing