SVG Sanitizer
Categories
Component ID
2616876
Component name
SVG Sanitizer
Component type
module
Maintenance status
Development status
Component security advisory coverage
covered
Downloads
945
Component created
Component changed
Component body
Integrates Drupal with the SVG Sanitizer library https://github.com/darylldoyle/svg-sanitizer.
This module registers the SVG Sanitizer with Drupal's library api module. It also makes an SVG Sanitizer field formatter available for image and file fields that will attempt to remove non-whitelisted SVG attributes and tags and display the contents of the SVG file.
Features
- Adds a custom "SVG Sanitizer" field formatter that will remove non-whitelisted tags and attributes before rendering the SVG inline.
- Ability to add custom attributes to the list of whitelisted attributes.
Installation:
- Ensure that the Libraries API module is enabled.
- Download the contents of the svg-sanitizer library located at https://github.com/darylldoyle/svg-sanitizer and place it into your libraries directory. Make sure the directory is named svg_sanitizer.
- Enable the svg_sanitizer drupal module.
Demo:
Here is a brief demo, https://www.youtube.com/watch?v=Nb9W9-Ufq0g
