Sanitize HTML inputs with the sanitize-html package.
npm install directus-extension-sanitize-html
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
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
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
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
GPLv3 License. See the LICENSE file.