-
Notifications
You must be signed in to change notification settings - Fork 56
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
Escaping JS for html <script> tags #79
Comments
As @sio4 stated, it's possible to use this in a safe way: <!-- fixed.html -->
<h1>Some HTML with JS</h1>
<script>
<% let message = partial("someText.txt") %>
console.log("<%= jsEscape(inspect(message)) %>")
</script> Printing |
I think this issue is not so important and improving this is much expensive than we can get. |
Long and old story :-) As the example shows, the issue is not directly caused by the The usage is the user's own thing, so users (developers) need to be careful about it if they use the I am going to close this long (including the history of the original PR #77) and old issue today, but please feel free to reopen it if you feel this issue is critical. Better examples and descriptions will help to triage the issue more. PR is also welcome. Additionally, Lines 189 to 235 in 2719ced
|
Partials in html
<script>
tags don't get escaped, possibly breaking JS code._someText.txt
would not get JS escaped as the content-type istext/html
.I don't know a simple way to fix this and I'm not sure if we should escape it.
From my understanding, this would be a lot of work including teaching plush how to parse html.
Originally posted by @lukasschlueter in #77 (comment)
The text was updated successfully, but these errors were encountered: