3 ms·
Just looking at the template bit... why do you use text/template and not html/template? I get that you wrote the templates, you trust them, you don't want the
by buro9 10y ago
Just looking at the template bit... why do you use text/template and not html/template?
I get that you wrote the templates, you trust them, you don't want the HTML escaping, etc... but is that true of the content you display?
Also missing (in general, from Go instructionals on web apps that dare to stray into HTML) is internationalisation and localisation.
- astockwell 10y agoUsually that's a goimports gotcha. Definitely want to be using html/template though.
- thewhitetulip 10y ago> internationalisation and localisation These will be the next topics to be added :-) Also, I use visual studio code, so haven't really written import statements on my own! I'll use html/template, because no matter who wrote the templates, escaping them is a good idea
- zenlikethat 10y agoFWIW, the reason you're interested in escaping HTML templates is not usually the templates themselves but the user content that gets injected into them.
- thewhitetulip 10y agoYes, I understand.