SVGInjector messes up id's inside defs
See original GitHub issueThe index of the injected svg seems to be inserted after id’s, which is breaking url references
eg:
fill: url(#green)
image.svg:
<defs>
<linearGradient id="green">
...
</linearGradient>
</defs>
But when injected:
<defs>
<linearGradient id="green-0">
...
</linearGradient>
</defs>
Issue Analytics
- State:
- Created 8 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
conflicting ids in two different SVG files included in the same ...
SVG injectors like Iconic SVGInjector or the newer Iconfu SVGInject handle this issue by making the IDs unique when inserting the SVG into ......
Read more >24251 (Reconsider SVG inclusion to get_allowed_mime_types)
There are some who think SVG should be included in core as an allowed mime type. ... through explanation that it is not...
Read more >If You're Inlining SVG Icons, How Do You Deal With Unique ...
Personally I wouldn't use ids on svgs at all. If you need an icon to be clickable then wrap it in a span...
Read more >Reference Svg File In Html - Atlantis Diving Centre
then the DTD will be downloaded from the URL specified in the system identifier. Stay up to date with the latest web design....
Read more >Analysis Report Avnet Technology Showcase_Event_IN (002 ...
JA3 SSL client fingerprint seen in connection with other malware ... Let us know your email address so that we can follow up...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the exact same issue. I have a radialGradient with an id where it is targeted throughout the svg file as a fill attribute with this id. How can I make this work?
I had issue in SVG loading by svg-injector ver 1.1.3. So, followed this solution but now SVG’s colors aren’t displaying correctly. SVG Image don’t load on when injector override defs id=“a-1” color display correctly. and incorrect color displaying without injector override default id=“a” while image load properly. Can anyone suggest me the needful solution to avoid this issue?