0.8.3 • Published 8 years ago

html5-purifier v0.8.3

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

node-html5-purifier

Code Climate

Purify dirty HTML and CSS into standards compliant and namespaced code.

Cleans up any input into standards compliant DOM safe code, both CSS and HTML5.

Can pass in prefix and postfix values for namespacing all elements, id's and classes within the html.

purifier.purify(html, options, cb);

Examples

Sanitize unsafe HTML

	var purifier = require('html5-purifier');
	var html = '<b onmouseover=alert('boo!')>click me!</b>';
	var options = {};
	purifier.purify(html, options, cb);

Returns:

<b>click me!</b>

Prefix and Postfix css classes

	var purifier = require('html5-purifier');
	var html = 'hello<span>world</a>';
	var options = { prefix: 'abc-', postfix: 'abc' };
	purifier.purify(html, options, cb);

Returns:

hello<span class="abc">world</span>
0.8.3

8 years ago

0.8.1

8 years ago

0.8.0

8 years ago

0.7.2

8 years ago

0.7.1

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.0

9 years ago

0.2.6

9 years ago

0.2.5

9 years ago

0.2.3

9 years ago

0.2.2

9 years ago

0.2.1

9 years ago

0.2.0

9 years ago

0.1.0

10 years ago