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

Arc segment is parsed incorrectly #822

Closed
subzey opened this issue Oct 31, 2017 · 1 comment
Closed

Arc segment is parsed incorrectly #822

subzey opened this issue Oct 31, 2017 · 1 comment
Labels

Comments

@subzey
Copy link
Contributor

subzey commented Oct 31, 2017

According to the spec, arc segments features flags: a fixed value 0 or 1. These flags are currently parsed as a number by svgo. This approach is more forgiving, but it's also a reason svg can be parsed incorrectly.

For example, an arc a1 1 0 001 1:

Rx Ry rot large arc sweep x y
Spec 1 1 0 0 0 1 1
svgo 1 1 0 001 1

As a result, svgs with comma-wsp? omitted after any of the flags makes svgo crash or produce incorrect results. This file is displayed correctly in all browsers and IE11+, but is broken after svgo 1.0.1.

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 7 7">
  <path d="
    m 0 0
    a 1 1 0 001 1
      1 1 0 001 1
      1 1 0 001 1
      1 1 0 001 1
      1 1 0 001 1
      1 1 0 001 1
      1 1 0 001 1
  "/>
</svg>
@GreLI
Copy link
Member

GreLI commented Oct 31, 2017

Thanks, that's interesting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants