Currently sanitizing script and style stags preserves the internal content as escaped html:
sanitize "<script>console.log('foo');</script>"
-- "console.log('foo');"
sanitize "<style>* { color: red }</style>"
-- "* { color: red }"
This is of course perfectly safe. However it seems very unlikely to be the desired resulting html.
Accordingly it seems like an explicit clear-list of html tags that should be emptied instead of escaped would be useful, with ["script", "style"] as the default list.
One could reasonably argue that <head> should make the list as well.
Currently sanitizing script and style stags preserves the internal content as escaped html:
This is of course perfectly safe. However it seems very unlikely to be the desired resulting html.
Accordingly it seems like an explicit clear-list of html tags that should be emptied instead of escaped would be useful, with
["script", "style"]
as the default list.One could reasonably argue that
<head>
should make the list as well.