htmlsanitizer
v0.0.2
Published
A wrapper for calling htmlsanitizer.org
Downloads
6
Readme
node-htmlsanitizer
A simple wrapper for calling httpsanitzer.org (which itself is a wrapper for calling bleach.clean
from the python bleach library)
Usage
Default options
{
text: null,
tags: [
'a',
'abbr',
'acronym',
'b',
'blockquote',
'code',
'em',
'i',
'li',
'ol',
'strong',
'ul',
],
attributes: {
a: ['href', 'title'],
abbr: ['title'],
acronym: ['title'],
},
styles: [],
strip: false,
stripComments: true
}
sanitize(String, callback) // use the defaults
sanitize(Object, callback) // override some or all of the defaults
callback
has the classic signature function (error, safehtml)