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

SVG paths with no superfluous spaces get mangled in some cases #3432

Closed
p-himik opened this issue Mar 9, 2022 · 1 comment
Closed

SVG paths with no superfluous spaces get mangled in some cases #3432

p-himik opened this issue Mar 9, 2022 · 1 comment
Labels
bug For bugs or other software errors

Comments

@p-himik
Copy link

p-himik commented Mar 9, 2022

Extracting #3377 (comment) into a separate issue.

A simple path M1 0A1 1 0 00-1 0 1 1 0 001 0M0-1 1 0M-1 0 0 1:
image

gets mangled into M11.180339887498949,0C11.180339887498949,6.174731217790598,6.174731217790599,11.180339887498949,6.845983728302534e-16,11.180339887498949M0,-11.180339887498949L11.180339887498949,0M-11.180339887498949,0L0,11.180339887498949:
image

The reason seems to be that, while M1 0A1 1 0 00-1 0 1 1 0 001 0 is a perfectly valid SVG (at lest, works in all browsers and editors that I've tried), the SVG parser cannot handle 00-1 and 001 parts.

The standard is terse but unambiguous here:

Superfluous white space and separators (such as commas) may be eliminated

00 above are flags, so separating them from each other and from the next number is indeed superfluous.

Another example: M.5-.8.5.8 gets parsed as M 0.5 -0.8. The implicit line part gets chopped of.

@p-himik p-himik added the bug For bugs or other software errors label Mar 9, 2022
@jheer
Copy link
Member

jheer commented Mar 11, 2022

Thanks! Fixed for v5.22.0.

@jheer jheer closed this as completed Mar 11, 2022
@jheer jheer mentioned this issue Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug For bugs or other software errors
Projects
None yet
Development

No branches or pull requests

2 participants