Hacker News new | ask | show | jobs
by aitchnyu 959 days ago
Umm, how do the templates escape malicious input (XSS)?
2 comments

It seems to be based on lit-html, so anything that's interpolated gets automatically sanitised unless you're using a directive[1] or interpolate other templates created using the "html" function.

[1]: https://lit.dev/docs/api/directives/#unsafeHTML

I've mainly designed this for backend devs (i.e. rails, django people who just render plain html/css on the front-end), and we generally do HTML sanitization on the server side.

Example: https://api.rubyonrails.org/classes/ActionView/Helpers/Sanit...