Skip to content

gaearon/scribe-plugin-sanitizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scribe-plugin-sanitizer

Installation

bower install scribe-plugin-sanitizer

Usage Example

scribe-plugin-sanitizer is an AMD module:

require(['scribe', 'scribe-plugin-sanitizer'], function (Scribe, scribePluginSanitizer) {
  var scribeElement = document.querySelector('.scribe');
  var scribe = new Scribe(scribeElement);
  scribe.use(scribePluginSanitizer({
    tags: {
      p: true,
      a: {
        href: true,
        target: '_blank'
      }
    }
  }));
});

It uses the same format of options as html-janitor. To whitelist a tag, specify true for it. To whitelisted specific attributes or even specific values, use an object.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%