Skip to content
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

Support Adobe generated SVG files #118

Closed
edwinm opened this issue Oct 15, 2015 · 4 comments
Closed

Support Adobe generated SVG files #118

edwinm opened this issue Oct 15, 2015 · 4 comments
Assignees

Comments

@edwinm
Copy link

edwinm commented Oct 15, 2015

SVG files generated by Adobe software often have a path with "&st0;" as the value of the style attribute.

svg-sprite does not support this.

Warning: The following errors occured:
✖ Skipping "img/icon-arrow-down-black.svg" (Invalid SVG file (element parse error: ArgumentError: Invalid SVG file (entity not found:&st0; @#[line:7,col:2]) @#[line:7,col:2]))

Please ignore this entity and process the SVG file.

Here is an example of a SVG generated by Adobe software:

]>




@jkphl jkphl self-assigned this Oct 15, 2015
@jkphl
Copy link
Collaborator

jkphl commented Oct 15, 2015

Hey @edwinm,

could you please provide a full example SVG file that I could use for experimenting?

The error isn't genuinely an svg-sprite one but raised by xmldom. I have no idea if I can tell xmldom to ignore the entity ...

Cheers, Joschi

@edwinm
Copy link
Author

edwinm commented Oct 15, 2015

Hope this works

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
    <!ENTITY st0 "fill:#000000;">
]>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px"
     height="24px" viewBox="0 0 24 24" style="enable-background:new 0 0 24 24;" xml:space="preserve">
<g id="down">
    <path style="&st0;" d="M12.8,17.8C12.8,17.7,12.8,17.7,12.8,17.8L12.8,17.8l10-10c0.4-0.4,0.4-1.1,0-1.5c-0.4-0.4-1.1-0.4-1.5,0
        L12,15.5L2.7,6.2c-0.4-0.4-1.1-0.4-1.5,0c-0.4,0.4-0.4,1.1,0,1.5l10,10l0,0c0,0,0,0,0,0C11.7,18.2,12.3,18.2,12.8,17.8z"/>
</g>
</svg>

@jkphl
Copy link
Collaborator

jkphl commented Oct 15, 2015

Thanks!

@jkphl
Copy link
Collaborator

jkphl commented May 14, 2016

Trying to take care of this now. As expected this is a well known xmldom issue, but the author doesn't seem interested in working on this ... Trying to find a solution ...

@jkphl jkphl closed this as completed in 1b8eec6 May 14, 2016
jkphl added a commit that referenced this issue May 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants