Directus Extension Sanitize Html

screenshot of Directus Extension Sanitize Html
directus

Directus custom extension to sanitize HTML inputs

Overview:

The Directus Extension - Sanitize HTML is a package that allows users to sanitize HTML inputs using the sanitize-html package. It provides features to customize event scopes, omit paths for sanitization, specify allowed HTML tags, and define the action taken for disallowed tags. The extension is compatible with Directus, a headless CMS.

Features:

  • Sanitize HTML inputs: The extension allows users to sanitize HTML inputs using the sanitize-html package.
  • Customize event scopes: Users can specify which event scopes to sanitize by adding the EXT_SANITIZE_HTML_EVENT_SCOPES environment variable with the event scopes separated by commas.
  • Customize omitted paths: Users can specify which paths to omit for sanitization by adding the EXT_SANITIZE_HTML_OMIT_PATHS environment variable with the collection.path separated by commas.
  • Customize allowed HTML tags: Users can define the HTML tags that are allowed by adding the EXT_SANITIZE_HTML_ALLOWED_TAGS environment variable with the html-tag separated by commas.
  • Define action for disallowed tags: Users can specify the action to be taken for disallowed tags by adding the EXT_SANITIZE_HTML_DISALLOWED_TAGS_MODE environment variable with discard, escape, or recursiveEscape options.

Summary:

The Directus Extension - Sanitize HTML is a useful package for sanitizing HTML inputs in Directus. It provides flexibility in customizing event scopes, omitted paths, allowed HTML tags, and the action taken for disallowed tags. By adding specific environment variables, users can easily configure the extension to fit their needs. It is important to ensure the correct installation and license compliance when using the package.

directus
Directus

A website that uses Directus as an open source headless CMS to manage content. This includes features such as a customizable content model, role-based access control, and API-based content delivery to support a wide range of digital experiences.

Recoil

Recoil is a state management library for React that provides an intuitive and flexible API for managing and sharing state across components. It supports a range of features, including derived state, asynchronous updates, and time-travel debugging, and is designed to work well with the React ecosystem and other state management solutions.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.