-
-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SVG files that start with XML header cause issues when used as a component #94
Comments
Tbvh I don't know I want to support icons which have xml headers. Are they needed at all? To me it seems like it's an obsolete way of defining SVG icons. |
If you're writing SVG by hand, sure, maybe you don't need to worry about it. However, this generated by a file I exported as SVG by Illustrator. It might be possible to control that export plugin but having to know/remember to go in and remove something from a standard-ish graphics tool like Illustrator doesn't seem like the right call. The problem is, it wasn't immediately obvious what was wrong or why it was a problem for some SVG files and not others. Took me a bit to see the only difference was the files that had problems had the For my part, supporting this case could be removing TL;DR: You're not wrong; might be unneeded in some cases with some tools. The fact that some tools do add this automatically and it isn't obvious from the outside that this is going to cause an issue until it does makes me think something should be done to help people out here. |
I did a quick bit of extra research on this and found this article that seems to summarize what some of the other material says about this bit of XML prolog:
So, it does seem like it could be considered safe to strip the I'd be happy to experiment with this if you're not entirely opposed to introducing this support to this package. :) |
Fixed in #116. Will be in the next release. |
Description:
When an SVG is used as a component and happens to have
<?xml
header, things go wonky.Important to note that you can still use
@svg()
just fine. It's only when you try to use thex-
component that it breaks.Steps To Reproduce:
Trying to use this SVG gives an error...
... while this version does not...
Removing the XML header makes the second SVG work as a component:
The text was updated successfully, but these errors were encountered: