directus-extension-sanitize-html

0.0.4 • Public • Published

Directus Extension - Sanitize HTML

Sanitize HTML inputs with the sanitize-html package.

NPM version License NPM downloads

Installation

npm install directus-extension-sanitize-html

Options

Customize which event scopes to sanitize

Add the EXT_SANITIZE_HTML_EVENT_SCOPES environment variable with the event scopes separated by commas.

Defaults to running items.create,items.update.

Example: articles.items.create,articles.items.update

Customize which paths to omit for sanitization

Add the EXT_SANITIZE_HTML_OMIT_PATHS environment variable with the <collection>.path separated by commas.

Defaults to no path to omit.

Example: articles.content,website.rawHtml

Customize which HTML tags are allowed

Add the EXT_SANITIZE_HTML_ALLOWED_TAGS environment variable with the <html-tag> separated by commas.

Defaults to undefined, using the defaults from sanitize-html.

Example: a,b,i,em,strong

Customize the action taken for disallowed tags

Add the EXT_SANITIZE_HTML_DISALLOWED_TAGS_MODE environment variable with discard, escape or recursiveEscape.

Defaults to undefined, using the defaults from sanitize-html.

Example: escape

License

GPLv3 License. See the LICENSE file.

Package Sidebar

Install

npm i directus-extension-sanitize-html

Weekly Downloads

14

Version

0.0.4

License

GPL-3.0

Unpacked Size

287 kB

Total Files

4

Last publish

Collaborators

  • licitdev