You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Sanitize doesn't behave how I would expect when dealing with child elements of blocked nodes. The root node is blocked but the children are not removed even if they match a blocked or dropped element.
Hello! Sanitize doesn't behave how I would expect when dealing with child elements of blocked nodes. The root node is blocked but the children are not removed even if they match a blocked or dropped element.
Blocked Elements
{ blockElements: ["body", "h1"] }
<body><h1>Hello World!</h1><p>Testing</p></body>
Expected result:
<p>Testing</p>
Received result:
<h1>Hello world!</h1><p>Testing</p>
Dropped Elements
{ blockElements: ["body"] }
(Script dropped automatically)<body><script>console.log("pwnd")</script><p>Testing</p></body>
Expected result:
<p>Testing</p>
Received result:
<script>console.log("pwnd")</script><p>Testing</p>
Here are the test cases I used to confirm this behavior:
sanitize.test.ts
The final of the three tests passes correctly, but it may be a useful test case.
The text was updated successfully, but these errors were encountered: