rehype plugin to sanitise HTML.
npm install rehype-sanitize
Say we have the following file,
And our script,
example.js, looks as follows:
var fs =var rehype =var merge =var gh =var sanitize =var schema =data'settings' fragment: true
node example yields:
Remove potentially dangerous things from HTML, or more correct: keep only safe the things in a document.
The sanitation schema defines how and if nodes and properties should be cleaned.
The schema is documented in
hast-util-sanitize— Core utility that does the sanitation
This project has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.