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

8 Commits

Author SHA1 Message Date
Bogdan Chadkin
e4918ccdd1
Covert removeHiddenElems with types (#1532)
Covered removeHiddenElems plugin and big part of our code
- path parser and stringifier
- style manager
2021-08-21 14:55:05 +03:00
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
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
Sebastian Kreft
76c7719604
chore: Improve TS config (#1405)
Changed the TS config file to include all relevant folders and explicitly exclude those files that fail the type checks. In this way new files will be automatically type checked and we can see the list of files that need types improvements.

In this pass I also fixed some js files.
2021-03-05 01:17:44 +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