1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-27 07:02:06 +03:00
Commit Graph

24 Commits

Author SHA1 Message Date
Seth Falco
747cc722d9 chore: revamp how we export types (#2118) 2025-05-04 17:39:44 +01:00
Seth Falco
e065d1000e deps: upgrade pixelmatch for performance improvements (#2102) 2025-04-11 16:22:50 +01:00
Seth Falco
f3495ff6c9 fix(removeEmptyContainers): skip if filter is applied via styles as well (#2089)
Fixes a bug where we were too eager to remove empty containers.

We already had logic to skip removing empty containers if it had the
filter attribute, which is needed to apply a filter to the whole area.
However, the filter can also be defined through CSS. We did not
properly handle this case, and treated the node as if it had no filter
at all.

This computes the styles and checks the stylesheet as well. (We also
move the logic down to avoid computing the styles eagerly.)
2024-12-22 16:01:22 +00:00
XhmikosR
4daaa4251f chore: update ESLint to v9 and switch to flat config (#2001) 2024-05-26 13:22:23 +01:00
Seth Falco
ceb2178935 test: expand and optimize regression testing (#1918) 2024-05-25 23:44:26 +01:00
Jon Dufresne
2442f74239 chore: convert project to us ECMAScript modules (preserving CJS compatibility) (#1905) 2024-01-03 16:17:37 +00:00
Seth Falco
52961ba28c ci: dont create diff png if no_diff (#1903) 2023-12-25 14:06:44 +00:00
Seth Falco
2c408ce56f refactor: improve regression testing (#1898) 2023-12-23 06:56:46 +00:00
Kendell R
16c6977215 chore: speedier regression testing (#1897) 2023-12-23 03:21:14 +00:00
Seth Falco
22533f1ffe chore: update prettier and eslint (#1885) 2023-12-15 13:10:21 +00:00
Seth Falco
7d481acfea test: enable regression test that now passes (#1833) 2023-11-13 15:12:40 +00:00
Seth Falco
96fedb4855 chore: change link to homepage in package.json (#1824)
Change the link of the homepage from this Git repository (which is
already documented in `bugs` and `repository` to a link to the
documentation.
2023-11-08 16:00:36 +00:00
Seth Falco
5aad38bcc7 fix(inlineStyles): empty css block created empty attribute (#1823)
When running this plugin on an SVG with an empty block in the CSS, it
would apply it to the matched elements by adding an empty `style`
attribute. See the test for an example.

This resolves that by just dropping the declaration if it's empty.
2023-11-07 23:20:48 +00:00
Seth Falco
7e99c0bd49 fix(inlineStyles): case insensitive style props (#1797)
Style property names are case-insensitive, for example `fill`, `FILL`,
and `FiLl` are all valid but refer to the same property. So when
inlining styles, we compare the lowercase strings and only use the last
instance of the property rather than embed them all.
2023-09-25 19:05:11 +01:00
Seth Falco
f07e9de089 fix: resolve regression test for removeHiddenElems (#1793) 2023-09-25 19:04:06 +01:00
Bogdan Chadkin
d89d36eace Split regression extracter and runner (#1451)
A lot of new sources of regression tests may come and it's important to
make debug simpler.

Now regression-extract.js downloads and write svg files into
test/regression-fixtures. regression.js run each svg in this folder.
Mismatched svg diff is written into test/regression-diffs.
2021-03-25 00:12:13 +03:00
Bogdan Chadkin
eb934b40f6 Serve svg for regressions and cache w3c test suite 2021-03-23 00:29:29 +03:00
Bogdan Chadkin
28c01cfe65 Preverve viewBox in nested <svg> 2021-03-06 13:39:31 +03:00
Bogdan Chadkin
a2b0e73767 Preserve conditional processing attributes 2021-03-06 13:18:53 +03:00
Bogdan Chadkin
d3e3726ac4 Keep markers with display: none 2021-03-06 11:21:47 +03:00
Bogdan Chadkin
0e6b0c4a01 Allow empty pattern when any attribute is present 2021-03-06 02:33:19 +03:00
Bogdan Chadkin
ba7e9bdc0d Fix collapsing repeated with marker-mid in style rule 2021-03-06 01:36:18 +03:00
Bogdan Chadkin
555a9619db Remove incorrect filter region assumption
Ref https://www.w3.org/TR/SVG11/filters.html

Spec says filter region is not always 100% 100% by default
2021-03-05 21:31:41 +03:00
Bogdan Chadkin
4d0ee0c330 Test regressions with W3C SVG 1.1 Test Suite (#1357)
Visual regressions tests will give us more confidence in SVGO stability.
Test cases are downloaded from w3.org, screenshooted with playwright and
compared with pixelmatch.
2021-03-04 18:00:15 +03:00