sanitizer for markdown-it.
npm install markdown-it-sanitizer


> sanitizer plugin for markdown-it markdown parser.
All tags are parsed case insensitive.
, , , , , ..., , ,
,
, , , , , , ,
$3
,
$3
textThe title attribute is optional.
$3

The alt and title attributes are optional.
Install
node.js, bower:
``bash
npm install markdown-it-sanitizer --save
bower install markdown-it-sanitizer --save
`
Use
#### Basic
`js
var md = require('markdown-it')({ html: true })
.use(require('markdown-it-sanitizer'));md.render('test
'); // => '
test
'
`#### Advanced
For not whitelisted tags and tags that don't have a matching opening/closing tag you can define whether you would like to remove or escape them. You can also define a class attribute that will be added to image tags. Here is an example with default values:
`js
var md = require('markdown-it')({ html: true })
.use(require('markdown-it-sanitizer'), {
imageClass: '',
removeUnbalanced: false,
removeUnknown: false
});// unknown tag
md.render('test'); // => '
<u>test</u>
'
// unknown tag with removeUnknown: true
md.render('test'); // => 'test
'// unbalanced tags
md.render('test'); // => '
<b>test</em>
'
// unbalanced tags with removeUnbalanced: true
md.render('test'); // => 'test
'// imageClass: 'img-responsive'
md.render('
'); // => '

'`_Differences in the browser._ If you load the script directly into the page, without
package system, the module will add itself globally as
window.markdownitSanitizer`.