Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
theSmaw committed Oct 29, 2010
1 parent b64d205 commit b271e75
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<h2>Usage:</h2>
=====================

Installation:

Expand Down
29 changes: 29 additions & 0 deletions README.md.txt
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

0 comments on commit b271e75

Please sign in to comment.