1.0.2 • Published 4 years ago

egg-html-purify v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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