Sanitise HTML with rehype.
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.
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
rehypejs/rehype for ways to get
This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.