svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

fix arc flags parsing #1175

Closed mlwilkerson closed 3 years ago

mlwilkerson commented 3 years ago

This PR proposes a fix for parsing Elliptical Arc commands in SVG paths. The parser has been failing to parse some valid arc commands. For example, the grammar allows for whitespace/comma to be omitted following one of the arc flags.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+0.0001%) to 99.889% when pulling 4980973cb1914d41392373e844ff323fa589c66f on FortAwesome:fix-elliptical-arc-flags-parsing into b2a0e2bcff2b3a3f568dbd3ec5ce843e217ee6d8 on svgdotjs:master.

Fuzzyma commented 3 years ago

Hm, I think I had that and couldnt find it in the grammar. Can you add another testcase for 3 consecutive zeros (or similar) for flag, flag and following number? Thanks for collaborating!

mlwilkerson commented 3 years ago

Ok, added some more test cases. All passing. (Though there was already the one failing test case at spec/modules/core/textable.js:27 in master before I branched.)

Fuzzyma commented 3 years ago

good to know :D. And thank you!!