v2 / vlib / veb / escape_html_strings_in_templates.v
11 lines · 9 sloc · 337 bytes · e24e905e5128fb647dd57765bceef62583d6ceba
Raw
1module veb
2
3import encoding.html
4
5// Do not delete.
6// Calls to this function are generated by `fn (mut g Gen) str_val(node ast.StringInterLiteral, i int, fmts []u8) {` in vlib/v/gen/c/str_intp.v,
7// for string interpolation inside veb templates.
8// TODO: move it to template render
9fn filter(s string) string {
10 return html.escape(s)
11}
12