-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
<h2>Usage:</h2> | ||
===================== | ||
|
||
Installation: | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<h2>Usage:</h2> | ||
================= | ||
|
||
Installation: | ||
|
||
npm install sanitizer | ||
|
||
|
||
Require: | ||
|
||
var sanitizer = require('sanitizer'); | ||
|
||
|
||
Use: | ||
|
||
sanitizer.escape('your dirty string'); // Escapes HTML special characters in attribute values as HTML entities | ||
|
||
var yourParser = sanitizer.makeSaxParser(yourHandler); // Given a SAX-like event handler, produce a function that feeds those events and a parameter to the event handler. | ||
|
||
sanitizer.normalizeRCData('your dirty string'); // Escape entities in RCDATA that can be escaped without changing the meaning. | ||
|
||
sanitizer.sanitize('your dirty string'); // Strips unsafe tags and attributes from html. | ||
|
||
exports.unescapeEntities('your string'); // The plain text of a chunk of HTML CDATA which possibly containing. | ||
|
||
|
||
More information: | ||
|
||
http://code.google.com/p/google-caja/source/browse/trunk/src/com/google/caja/plugin/html-sanitizer.js |