Package to replace
sanitize-html
Suggested replacement(s)
neosanitize package. By default, we suggest neosanitize/legacy as drop-in, and neosanitize with the prebuilt whatwg/parse5/htmlparser for more secure/correct as the correct path
Manifest type
preferred (lighter or more modern alternative package)
Rationale
sanitize-html ships entirity of postcss and other libraries just for very simple parsing at many places. neosanitize/legacy is a no-dep drop-in replacement passing all the tests of sanitize-html, and the relevant test suites of the upstream deps.
neosanitize itself comes by default a very fast WHATWG-parser, which is swappable with parse5, htmlparser2 as well
Availability
No response
Code example (optional)
Package to replace
sanitize-html
Suggested replacement(s)
neosanitize package. By default, we suggest
neosanitize/legacyas drop-in, andneosanitizewith the prebuilt whatwg/parse5/htmlparser for more secure/correct as the correct pathManifest type
preferred (lighter or more modern alternative package)
Rationale
sanitize-html ships entirity of postcss and other libraries just for very simple parsing at many places. neosanitize/legacy is a no-dep drop-in replacement passing all the tests of sanitize-html, and the relevant test suites of the upstream deps.
neosanitize itself comes by default a very fast WHATWG-parser, which is swappable with parse5, htmlparser2 as well
Availability
No response
Code example (optional)