How to use the sanitize-html.defaultOptions function in sanitize-html

To help you get started, we’ve selected a few sanitize-html examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github apostrophecms / apostrophe / lib / modules / apostrophe-rich-text-widgets / index.js View on Github external
self.optionsToSanitizeHtml = function(options) {
      return {
        ...sanitizeHtml.defaultOptions,
        allowedTags: self.toolbarToAllowedTags(options),
        allowedAttributes: self.toolbarToAllowedAttributes(options),
        allowedClasses: self.toolbarToAllowedClasses(options)
      };
    };

sanitize-html

Clean up user-submitted HTML, preserving allowlisted elements and allowlisted attributes on a per-element basis

MIT
Latest version published 2 months ago

Package Health Score

91 / 100
Full package analysis