0.1.0 • Published 9 years ago

gumbo-sanitize v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

gumbo-sanitize

Gumbo Sanitize is a loose port of the Ruby Sanitize library by Ryan Grove based on Google's Gumbo parser. This module differs from Sanitize.js in that it only supports nodejs and a subset of the Ruby Sanitize API.

Install

npm install --save gumbo-sanitize

Usage

var sanitize = require("gumbo-sanitize");
console.log(sanitize("<img src=javascript:alert('XSS')>", sanitize.RELAXED));
// prints <img>

Alternatively, you may also use the Sanitize class directly:

var Sanitize = require("gumbo-sanitize");
var s = new Sanitize(Sanitize.RELAXED);
console.log(s.sanitize("<img src=javascript:alert('XSS')>"));

Documentation

For now, please see the source code for documentation. Open to contributions :)

License

MIT