CONTENTS OF THIS FILE
SVG Formatter module provides support for using SVG images on your website.
Use Composer to install the module:
composer require drupal/svg_formatter
and then enable it with Drush:
drush en svg_formatter -y
- Add a file field to your content type, taxonomy or any other entity and add svg to the allowed file extensions.
- Go to the 'Manage display' and change the field format to 'SVG Formatter'.
- Set image dimensions if you want and enable or disable attributes.
Blog post describing how to use the module:
Please make sure that library 'enshrined/svg-sanitize' that is required in the composer.json file is installed, because otherwise your site may be vulnerable. If you allow users to upload SVG images and use inline SVG output mode, users may exploit XSS vulnerability.