svg-pathdata icon indicating copy to clipboard operation
svg-pathdata copied to clipboard

Suggestion: Return partly parsed data with the exception.

Open ievgennaida opened this issue 6 years ago • 1 comments

According to the: https://www.w3.org/TR/svg-paths/

The browser will render broken path data until the first error has occurred.

For example, for the path data string 'M 10,10 L 20,20,30', there is an odd number of parameters for the "L" command, which requires an even number of parameters. The user agent is required to draw the line from (10,10) to (20,20) and then perform error reporting since 'L 20 20' is the last correctly defined segment of the path data specification.

I would assume that lib should also have the possibility to return at least a valid part of the path data.

Is it possible to extend the exception with the partly parsed data?

ievgennaida avatar Apr 08 '20 23:04 ievgennaida

@ievgennaida it would certainly make sense to do so feel free to PR.

nfroidure avatar Apr 10 '20 09:04 nfroidure