apostrophecms / sanitize-html

Clean up user-submitted HTML, preserving whitelisted elements and whitelisted attributes on a per-element basis. Built on htmlparser2 for speed and tolerance
MIT License
3.68k stars 349 forks source link

added option disallowedTagsMode: 'completelyDiscard' #656

Closed gkumar9891 closed 3 months ago

gkumar9891 commented 4 months ago

Added disallowedTagsMode: 'completelyDiscard' option to remove content from disallowed tags.

BoDonkey commented 4 months ago

Please add something like this to the README.md file:

If you set `disallowedTagsMode` to `completelyDiscard`, disallowed tags and any content they contain are discarded. Any subtags are still included, as long as those individual subtags are allowed.
BoDonkey commented 4 months ago

There is a section starting at line 244 that also needs the completelyDiscard option added.