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.
Ref https://github.com/svg/svgo/issues/1385
With disabled convertStyleToAttrs applyTransform fails to transform
inline styles. They are considered as deoptimisation for now.
Future style manager should fix the problem.
This bug was also catched by regression tests. Single state was
overriden in opentag/closetag callbacks. Using stack state solved the
problem with nested textual tags.
Now many whitespaces bugs should go away.
There was a lot of PR with switching to another xml parser because sax
is not maintained for almost 4 years already.
Though switching parser to solve a few problems may introduce many new
bugs. This is why we decided to fork sax and maintain own version.
For initial release I removed node streams support which allows to get
rid from some magic in browser bundle build config and got rid from
String.fromCodePoint polyfill.
Forked package is here https://github.com/svg/sax
* Path intersection was not checking paths with circles.
As an optimization the path intersection was checking the paths had three or more elements, caliming that otherwise there was nothing to fill. However a semi circle would actually contain 2 points.
Fixes#1048.
This adds a simplified test case for the 2 offending files reported in the issue.
* Add issue templates
We add issue templates for:
- Bug Reports
- Feature Requests
- Plugin Requests
- Pull Requests
- Questions
* Add Github issue templates
Fixes#1364, but is is missing the template for pull requests see
https://docs.github.com/en/github/building-a-strong-community/creating-a-pull-request-template-for-your-repository
* fix
* Use "New plugin" label
Co-authored-by: Bogdan Chadkin <trysound@yandex.ru>