sanitize-html
Advanced tools
Changelog
1.7.2:
removed array-includes
dependency in favor of indexOf
, which is a little more verbose but slightly faster and doesn't require a shim. Thanks again to Joseph Dykstra.
Changelog
1.7.1:
removed lodash dependency, adding lighter dependencies and polyfills in its place. Thanks to Joseph Dykstra.
Changelog
1.6.1:
the string 'undefined'
(as opposed to undefined
) is perfectly valid text and shouldn't be expressly converted to the empty string.
Changelog
1.5.3:
do not escape special characters inside a script or style element, if they are allowed. This is consistent with the way browsers parse them; nothing closes them except the appropriate closing tag for the entire element. Of course, this only comes into play if you actually choose to allow those tags. Thanks to aletorrado.
Changelog
1.5.2:
guard checks for allowed attributes correctly to avoid an undefined property error. Thanks to Zeke.
Changelog
1.5.1:
updated to htmlparser2 1.8.x. Started using the decodeEntities
option, which allows us to pass our filter evasion tests without the need to recursively invoke the filter.
Changelog
1.5.0:
support for *
wildcards in allowedAttributes. With tests. Thanks to Calvin Montgomery.
Changelog
1.4.3:
invokes itself recursively until the markup stops changing to guard against this issue. Bump to htmlparser2 version 3.7.x.