Menu

#104 Better SVG path parser

Next Release
closed-fixed
nobody
svg (1)
5
2019-12-01
2017-04-01
Kpym
No

The svg.path library can't parse some valid paths when spaces are missing. For example the valid svg path M0,0 l0.5.5 (that is equivalent to M0,0 l0.5 .5 with space before the .5) generates an error.

The parser should parse a number until it is a valid (in the case of 0.5.5 it should read the number 0.5 because there is no valid number starting with 0.5.) and then continue like if the last symbol was space.

Another problem is that svg.path library can't parse scientific notations. For example the path M0,0 l0.5 .1e1 (that is equivalent to M0,0 l0.5 1) is not understood by the library.

Here is a link to the official svg path grammer.

Discussion

  • Stefan Pinnow

    Stefan Pinnow - 2019-12-01
    • status: open --> closed-fixed
     
  • Stefan Pinnow

    Stefan Pinnow - 2019-12-01