Skip to content

iyogeshjoshi/google-caja-sanitizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

google-caja-sanitizer

Port of the google caja html sanitizer library.

forked from node-google-caja

modified to allow data-* attributes while sanitizing the html input.

Build Status

Build Status

Install

You can install using the following command

#!shell
<root-directory>$ npm i --save google-caja-sanitizer

Use

Require the library and go

#!nodejs

var sanitize = require('google-caja-sanitizer').sanitize;
var result = sanitize('test<script>console.log("hi there");</script><div data-fruit="Apple">Apple</div>');

// Output:
// 'test<div data-fruit="Apple">Apple</div>'

Documentation Page

Please check the google page for more info on google caja sanitizer

About

Port of the google html sanitizer library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%