sanitize-hs
v1.1.2
Published
Sanitize hscript
Downloads
4
Readme
sanitize-hs
Sanitize an hyperscript tree (for virtual-dom).
Installation
$ npm install sanitize-hs
Usage
var sanitize = require('sanitize-hs');
var hscript = sanitize(h("h1", [ "Hello World" ]));
sanitize
also accept an option argument, default values can be found in defaults.js.
Replacing by escaped text
var sanitize = require('sanitize-hs');
var stringify = require('virtual-dom-stringify');
hscript = sanitize(hscript, {
replace: function(el) {
return {
text: stringify(el)
};
}
});