antfu-collective / icones

⚡️ Icon Explorer with Instant searching, powered by Iconify

Home Page:https://icones.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing xmlns attribute

adiba opened this issue · comments

commented

Describe the bug

The xmlns="http://www.w3.org/2000/svg" attribute is required for image/svg+xml files, but missing on all icons I've looked at.

In these cases Copy → Data URL will return an invalid image/svg+xml-URL and the SVG won't be displayed in an <img/> tag.

Options:

  1. Always add the xmlns attribute.
  2. Have a checkbox in the icon details area: "Add missing xmlns attribute to SVG"
  3. Have separate buttons to copy or download SVG as image/svg+xml vs. inline svg.

Reproduction

Select an icon (e.g., material-symbols:123) and copy SVG to clipboard. Paste and see that xmlns is missing.

System Info

N/A

Used Package Manager

n/a

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
commented

Same when download SVG files