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

Error in parsing SVG: Unexpected end #879

Closed
JoKalliauer opened this issue Dec 26, 2017 · 3 comments · Fixed by #2017
Closed

Error in parsing SVG: Unexpected end #879

JoKalliauer opened this issue Dec 26, 2017 · 3 comments · Fixed by #2017
Assignees

Comments

@JoKalliauer
Copy link

Processing file: https://commons.wikimedia.org/wiki/File:Tsumeshogi-classic.svg with

svgo -i Tsumeshogi-classic.svg -o output.svg

lead to an error:
Error in parsing SVG: Unexpected end

minimal working example (W3C-Valid file):
min.svg.txt

<?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"
  [
  <!-- Set the characters used for pieces here.
   The use of entities is the reason why the doctype is included,
   even though it's known to cause some problems. -->
]>

<svg xmlns="http://www.w3.org/2000/svg"
     xmlns:xlink="http://www.w3.org/1999/xlink"
     version="1.1"
     width="226px" height="201px">
<text x="5" y="2">9</text>
</svg>

I think svgo has a prpblem with the comment in the doctype.

@GreLI
Copy link
Member

GreLI commented Dec 26, 2017

Yep, SVGO is based on SAX parser which has such issues.

@XhmikosR
Copy link
Contributor

@TrySound this doesn't throw any error but results in an empty file with v2.1.0:

C:\Users\xmr\Desktop>svgo 1.svg --pretty -o 2.svg

1.svg:
Done in 5 ms!
0.492 KiB - 100% = 0 KiB

Shouldn't it throw an error if it has trouble parsing it?

@TrySound
Copy link
Member

I will fix parsing soon

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

Successfully merging a pull request may close this issue.

5 participants