-
Notifications
You must be signed in to change notification settings - Fork 26
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
Incorrect escaping inside STYLE and SCRIPT elements. #6
Comments
As another example, the ampersand should not be encoded as html`<style>
p {
background-image: url(${"foo.png?bar=1&baz=2"});
}
</style>` |
We implemented this within a fork of this project for Julia, this turned out to be relatively easy. Most of the state machine already tracks what you need to keep the current element name, and you only have to match on |
@clarkevans Thanks for the pointer! I’d like to fix this together with #18; see #21 (comment). |
STYLE and SCRIPT elements have special behavior regarding escaping: they use “RAWTEXT” rather than “DATA” mode. For example, this is not an ampersand character reference:
I think this means we’ll need to track the element name when we enter the DATA state, and if it’s STYLE or SCRIPT, enter the RAWTEXT state instead. And then likewise we’ll have to handle the “appropriate end tag” to determine when we exit the RAWTEXT state.
The text was updated successfully, but these errors were encountered: