shrpne / vue-inline-svg

Dynamically loads an SVG source and inline <svg> element so you can manipulate the style of it
MIT License
175 stars 21 forks source link

Prepend title for backwards compatibility with SVG 1.1 #48

Closed tylerrzaneray closed 1 year ago

tylerrzaneray commented 1 year ago

When appending a title to an SVG with vue-inline-svg the <title> element is appended to the end of the SVG:

<svg>
  <path>...</path>
  <title>foo</title>
</svg>

Per MDN, the title element should be the first element in the SVG for backwards compatibility with SVG 1.1.

<svg>
  <title>foo</title>
  <path>...</path>
</svg>

Would it be possible to set the title element as the first child of the SVG instead of the last?