Skip to content

brianloveswords/node-htmlsanitizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-htmlsanitizer

A simple wrapper for calling httpsanitzer.org (which itself is a wrapper for calling bleach.clean from the python bleach library)

Usage

Install with npm install htmlsanitizer

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  
}
htmlsanitizer(String, callback) // use the defaults
htmlsanitizer(Object, callback) // override some or all of the defaults

callback has the classic signature function (error, safehtml)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published