-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xmlEncode #11
Comments
Interesting idea - My only concern would be it interfering with some other nim syntax. What about adding another prefix to indicate escape; like '$!' instead of just '$' ? i..e. import templates
let x = "<script>alert("hello")</script>"
let dom = tmpli html"""
<p>$!x</p>
"""
assert dom == "<p><script>alert("hello")</script></p>" |
@onionhammer |
Yeah good point. I wouldn't want to issue a breaking change for this, but syntactic sugar for escaping the HTML would be nice. |
Variable should be xml encoded to prevent XSS
https://nim-lang.org/docs/cgi.html#xmlEncode%2Cstring
so I propose a new syntax if possible
then it shoud be like this
The text was updated successfully, but these errors were encountered: