1
0
mirror of https://github.com/svg/svgo.git synced 2025-04-19 10:22:15 +03:00

7 Commits

Author SHA1 Message Date
Josep del Rio
454b4277a3
Remove flag spaces for all arcs (#1484)
Ref #1476

The issue is that a path command may have multiple arcs, and the space optimization was only applied to the first one. Modified a test to check it.


Co-authored-by: Josep del Río <joseprio@fb.com>
Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>
2021-08-12 21:51:26 +03:00
Bogdan Chadkin
c3695ae533
Migrate to jest (#1520)
Mocha doesn't have a lot of features provided by jest.
There is a great assertion library out of the box.
And the most cool feature is inline snapshots.
Mocha also hides errors which makes debugging a nightmare sometimes.
2021-08-12 18:06:10 +03:00
Bogdan Chadkin
3d4adb6b04 Simplify number rendering and fix -0 in path
Ref https://github.com/svg/svgo/issues/1422
2021-03-22 14:38:06 +03:00
Bogdan Chadkin
0e02fd9fde Fix noSpaceAfterFlags support 2021-03-04 13:15:36 +03:00
Bogdan Chadkin
d6f972c970 Fix scientific notation parsing in paths 2021-03-02 11:49:54 +03:00
Bogdan Chadkin
04b2ae9a37
Implement path stringify (#1387)
Ref https://github.com/svg/svgo/issues/32

Added `stringifyPathData` utility to produce small as possible path by
- matching leading moveto and line to commands (m -> l, M -> L)
- combining moveto and lineto commands
- avoiding space before decimal numbers if possible
2021-03-02 01:07:26 +03:00
Bogdan Chadkin
4086e31334
Implement new path parser (#1378)
Regexps are quite leaky for complex parsing. Regression tests caught
a few issues related to path parser.

In this diff I implemented the new spec-compliant parser which solves
2 regression cases and covers many edge cases hard to handle with
regexps.
2021-02-28 22:10:57 +03:00