SVG Element Support

Version 2.0.0
Released On
Updated On
File Size 6.33 Kb
MD5 Signature 36e1957dac3f19017859c7f6b6937c8a
Licence GNU General Public License, Version 2 or later

Enable SVG elements in the editor

Installation

Install using the Joomla Extensions Installer - https://docs.joomla.org/Installing_an_extension

After installation, assign the plugin to an Editor Profile in Editor Profiles -> Features & Layout -> Additional Features by checking the SVG Elements option.

Enable the SVG Elements plugin for the editor profile

Usage

This plugin will allow common svg elements in the editor when added in the Code Editor or from some other source.

Important: Enabling the usage of SVG elements should be done with caution. SVG elements can potentially be exploited as an attack vector by malicious users. It is highly recommended to restrict the usage of this feature to trusted users or within a secure environment to mitigate any security risks.

Notes

This plugin adds support for the full list of SVG elements - https://developer.mozilla.org/en-US/docs/Web/SVG/Element - but for simplicity allows all possible attribute types for each element.

The tag is padded with a non-breaking space while editing to prevent its removal. This non-breaking space is removed on saving or when switching to code view.

Changelog

2.0.0

Added
  • Expanded SVG allowlist: Added core inline-SVG elements svg, defs, g, mask, clippath, lineargradient, radialgradient, stop, filter, fegaussianblur, symbol, use, image, text
  • Linking compatibility: Allowed both href (SVG2) and xlink:href (SVG 1.1) on <use>, <image>, and <a>.
Changed
  • Caret handling: Switched the closing </svg> spacer from &nbsp; to a zero-width space to prevent visible gaps while preserving caret/navigation behavior.
Fixed
  • Colour preservation:fill/stroke values like #fff, #0a0, named colours, rgb()/hsl() and keywords (none, currentColor, inherit) are now preserved (were previously removed when treated as fragments).
  • clipPath/filters visibility:clip-path, mask, and simple filter constructs (e.g. feGaussianBlur) survive round-trip.
Security
  • URL hardening inside SVG: Restricts clip-path, mask, filter, fill, stroke, and marker- to fragment refs only (#id / url(#id)).
  • Constrains href/xlink:href:<use> / SVG <a> → fragment refs only.

1.0.4

  • Add updateservers to the xml file

1.0.3

  • Patch in xlink:href attribute for tag

1.0.2

  • Make all element names lowercase to prevent removal

1.0.1

  • Update language file