All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Joining of same-tag siblings (would drop a whitespace when joining more than 2 nodes)
- Ran
npm audit fix
- Function
sanitizeHtml
now returns a HTML string instead of a DOM node snapshot. - Arguments for filter functions changed from
node, parents, parentNodeNames
tonode, { parents, parentNodeNames }
.
- Changed the default value of option
remove_tags_deep
from{ '.*': ['style', 'script', 'textarea', 'noscript'] }
to{}
. - Repository organization: Extraction of library functions into separate files.
- Code style improvements using
eslint
. - Performance: Regular expressions in options are now precompiled.
- Testing: Change to ES6 module format.
- Testing: Use Node's built-in function
assert
. - Testing: Support for browsers as well as Node.js.
- Testing: Switch from Jenkins to Github actions.
- Function
sanitizeDom
is no longer exported. It's internal use only. Use instead its wrapperssanitizeNode
,sanitizeChildNodes
, andsanitizeHtml
. - Removed recognition of the custom DOM Node properties
sanitize_skip_filters
,sanitize_skip
,sanitize_skip_filter_classes
, andsanitize_skip_filter_attributes
. These are now stored in aWeakMap
without theirsanitize_
prefix. SeeREADME
for more information. - Regular expression matching of node names removed wrapping between
^
and$
to increase flexibility.
- Added new option
allowed_empty_tags
to provide exceptions whenoptions.remove_empty
is set. - Added argument
siblingIndex
to filter functions. - Case-insensitive matching of tag names given in options.
- Filtering of attributes was broken (it operated on a live node set instead of a snapshot)