Sanitize rendered SVG in place by removing the vectors that can run script.
Call this on the container element after rendering if you need additional security.
Removes <script> and <foreignObject> elements, every on* event-handler
attribute (not a fixed list: any attribute whose name starts with on),
javascript: / vbscript: / data: URLs on link and resource attributes, and
<use> elements that reference an external document.
Sanitize rendered SVG in place by removing the vectors that can run script. Call this on the container element after rendering if you need additional security.
Removes
<script>and<foreignObject>elements, everyon*event-handler attribute (not a fixed list: any attribute whose name starts withon),javascript:/vbscript:/data:URLs on link and resource attributes, and<use>elements that reference an external document.