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

Fails on markup declarations in Doctype declaration #8

Closed
kraftner opened this issue Aug 19, 2016 · 0 comments
Closed

Fails on markup declarations in Doctype declaration #8

kraftner opened this issue Aug 19, 2016 · 0 comments

Comments

@kraftner
Copy link
Contributor

If your Doctype declaration contains a markup declaration is-svg fails.
I know that this package only does a quick-and-dirty check and you'd might call this an ignorable edge-case. The problem is that the default export from at least Illustrator CS4 (I know, old, but probably still not that rare) creates this...

<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In  -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
    <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]>
<svg version="1.1"
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
     x="0px" y="0px" width="300px" height="300px" viewBox="-62.324 -49.991 300 300" enable-background="new -62.324 -49.991 300 300"
     xml:space="preserve">
<defs>
</defs>
<rect x="0.5" y="0.5" fill="#FFFFFF" stroke="#000000" width="171.383" height="171.383"/>
</svg>

... where <!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/"> makes is-svg fail

I noticed this because this makes imagemin-svgo ignore those files.

sindresorhus pushed a commit that referenced this issue Nov 4, 2016
* Update Regex to handle DTD markup declarations

Fixes #8

* Add test for DTD markup declaration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant