shivanshu3 / strip-js

[DEPRECATED] NPM Module which strips out all JavaScript code from some HTML text
MIT License
7 stars 7 forks source link

Stripping SVG files #1

Open mmc41 opened 7 years ago

mmc41 commented 7 years ago

Thanks a a cool library. I am interested in stripping embedded javascript from SVG (standalone or SVG embedded in HTML). Is that something that strip-js supports or aim to support ?

shivanshu3 commented 7 years ago

It should. Do you have a specific example you can provide so I can test it just to be sure?

shivanshu3 commented 7 years ago

Actually, no, I take it back. I tested with a simple SVG and it worked, but with a more complex SVG it corrupted it (although successfully removed all JavaScript from it). The reason is because this module sanitizes HTML before stripping out JavaScript, and can't handle generic XML tags.