[svgwg] Clarified path data omission rules (#827)

yisibl has just created a new issue for https://github.com/w3c/svgwg:

== Clarified path data omission rules ==
The current spec is only one sentence: 
> Superfluous white space and separators (such as commas) may be eliminated; for instance, the following contains unnecessary spaces:
M 100 100 L 200 200
It may be expressed more compactly as:
M100 100L200 200
Spec: https://svgwg.org/svg2-draft/paths.html#PathDataGeneralInformation

The SVG compressor needs a clear specification in order to compress spaces correctly. There is currently a problem with [svgo](https://github.com/svg/svgo/issues/1317). I can't be completely sure which implementation is correct.

Original svg

```svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 1125">
    <path d="M448.6,997.7c.2,5.6,16.6,9.4,36.5,8.4s35.8-6.2,35.5-11.8a1.7,1.7,0,0,0-.1-.7c-1.5-5.2-17.3-8.6-36.4-7.7s-34.4,5.8-35.5,11.1Z" fill="green" />
</svg>
```

### Use [svgo](https://github.com/svg/svgo) 

```svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 750 1125">
    <path d="M448.6 997.7c.2 5.6 16.6 9.4 36.5 8.4s35.8-6.2 35.5-11.8a1.7 1.7 0 00-.1-.7c-1.5-5.2-17.3-8.6-36.4-7.7s-34.4 5.8-35.5 11.1z" fill="green" />
</svg>
```

### Use svgcleaner

```svg
<svg viewBox="0 0 750 1125" xmlns="http://www.w3.org/2000/svg">
  <path d="m448.6 997.7c.2 5.6 16.6 9.4 36.5 8.4s35.8-6.2 35.5-11.8a1.7 1.7 0 0 0 -.1-.7c-1.5-5.2-17.3-8.6-36.4-7.7s-34.4 5.8-35.5 11.1z" fill="#008000"/>
</svg>
```

`00-.1` it seems that spaces cannot be omitted here.




Please view or discuss this issue at https://github.com/w3c/svgwg/issues/827 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 20 February 2021 10:09:25 UTC