sanitize-html
Advanced tools
Changelog
2.13.1 (2024-10-03)
allowedClasses
wildcard whitelist. Thanks to anak-dev
.Changelog
2.13.0 (2024-03-20)
Documentation update regarding minimum supported TypeScript version.
Added disallowedTagsMode: completelyDiscard
option to remove the content also in HTML. Thanks to Gauav Kumar for this addition.
Changelog
2.12.1 (2024-02-22)
post-css
. This fixes a vulnerability in which information about the existence or non-existence of files on a server could be disclosed via properly crafted HTML input when the style
attribute is allowed by the configuration. Thanks to the Snyk Security team for the disclosure and to Dylan Armstrong for the fix.Changelog
2.12.0 (2024-02-21)
Introduced the allowedEmptyAttributes
option, enabling explicit specification of empty string values for select attributes, with the default attribute set to alt
. Thanks to Na for the contribution.
Clarified the use of SVGs with a new test and changes to documentation. Thanks to Gauav Kumar for the contribution.
Do not process source maps when processing style tags with PostCSS.
Changelog
2.11.0 (2023-06-21)
false
in allowedClasses
attributes. Thanks to Kevin Jiang for this fix!.idea
temp files to .gitignore
Changelog
2.10.0 (2023-02-17)
disallowedTagMode
is set to any variant of escape
-- just escape the disallowed tags that are present. This fixes issue #464. Thanks to Daniel LiebnertagAllowed()
helper function which takes a tag name and checks it against options.allowedTags
and returns true
if the tag is allowed and false
if it is not.Changelog
2.9.0 (2023-01-27)
Changelog
2.8.1 (2022-12-21)
Changelog
2.8.0 (2022-12-12)
htmlparser2
to new major version ^8.0.0
. Thanks to Kedar Chandrayan for this contribution.Changelog
2.7.3 (2022-10-24)
false
, then do not assume that all tags are allowed. Rather, allow no tags in this case, to be on the safe side. This matches the existing documentation and fixes issue #176. Thanks to Kedar Chandrayan for the fix.