Skip to content

LubomirKurpel/Drupal-9-Insert-SVG-to-CKEditor

 
 

Repository files navigation

Drupal 9 Insert Inline SVG images into CKEditor.

This is a workaround module that supports inserting SVGs inline from CKEditor in Drupal 9. This module should in theory be redundant when https://www.drupal.org/node/1014816 is resolved.

The code is mainly a copy of D8 Editor File upload, which has been updated to insert an img element with its src attributed set to the uploaded SVG file instead.

After saving a post with an inserted SVG, the editor will return to the built-in image widget, where additional formatting and a caption can be added.

Installation

  1. Download and enable the module as usual.
  2. Go to your filters admin (admin/config/content/formats).
  3. Edit the format on which you want to enable the insertion of SVGs.
  4. Drag the 'S' icon to the "Active toolbar".
  5. Configure the plugin settings in the vertical tabs above the toolbar Save.

Currently tested on Drupal 9.2.7

About

Drupal 9 insert inline SVG images into CKEditor.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 57.6%
  • JavaScript 42.4%