Skip to content

neraliu/html-purify

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTML5 Purify

HTML5 Purifier - a fast and small footprint HTML5 purifier. The module uses a whitelist based approach to filter malicious characters,tags, attributes and attribute values while keeping the resulting output HTML5 compliant. It uses context parser for parsing the input string, xss filters for filtering URI attribute values and css-js for filtering CSS data within the HTML input.

npm version dependency status Build Status

Quick Start

Install html-purify from the npm repo

npm install html-purify

Server side use(nodejs)

/* create the html purifier */
var Purifier = require('html-purify');
var purifier = new Purifier();

var input = '...'; 
/* filter the input string */
var result = purifier.purify(input);

Development

How to build

npm install
npm run-script build

How to test

npm test

License

This software is free to use under the Yahoo Inc. BSD license. See the LICENSE file for license text and copyright information.

About

HTML5 Purify

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 71.6%
  • JavaScript 28.4%