egg-html-purify

1.0.2 • Public • Published

egg-html-purify

NPM version build status Test coverage David deps Known Vulnerabilities npm download

HTML5 Purifier plugin for egg.js

The plugin uses a whitelist based approach to filter malicious characters,tags, attributes and attribute values while keeping the resulting output HTML5 compliant.

Install

$ npm i egg-html-purify --save

Usage

// {app_root}/config/plugin.js
exports.htmlPurify = {
  enable: true,
  package: 'egg-html-purify',
};

Example

this.app.purify(input);
 
// or use in context
this.ctx.purify(input);

Questions & Suggestions

Please open an issue here.

License

MIT

Package Sidebar

Install

npm i egg-html-purify

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

6.64 kB

Total Files

8

Last publish

Collaborators

  • weihongyu12