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

28 Commits

Author SHA1 Message Date
Seth Falco
8c593fab06 chore: bulk update all jsdoc and jsdoctypes (#2114) 2025-05-01 22:16:52 +01:00
Seth Falco
4573d0178e chore: migrate plugin types to plugin (#2111) 2025-04-30 02:16:53 +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
Jon Dufresne
2442f74239 chore: convert project to us ECMAScript modules (preserving CJS compatibility) (#1905) 2024-01-03 16:17:37 +00:00
Seth Falco
a3da8b3a76 refactor: use set in _collections (#1899) 2023-12-24 01:54:17 +00:00
Vincent Bernat
f0ec586991 fix(removeEmptyContainers): don't remove empty containers if parent is switch (#1747) 2023-11-29 01:03:49 +00:00
Bogdan Chadkin
e2e65cfc1e Move plugin types into d.ts 2022-11-11 12:19:38 +03:00
Bogdan Chadkin
e6bd703b0a Remove unused active and type fields from plugins 2022-10-08 23:39:58 +03:00
Bogdan Chadkin
edbd433753 Refactor removeEmptyContainers (#1570)
- migrated to visitor plugin api
- covered with tsdoc
2021-09-14 18:03:29 +03:00
Bogdan Chadkin
07f8d606e0 Implement preset-default plugin (#1513)
I saw complaints about `extendDefaultPlugins` api

- it cannot be used when svgo is installed globally
- it requires svgo to be installed when using svgo-loader or svgo-jsx
- it prevents using serializable config formats like json

In this diff I introduced the new plugin which is a bundle of all
default plugins.

```js
module.exports = {
  plugins: [
    'preset_default',
    // or
    {
      name: 'preset_default',
      floatPrecision: 4,
      overrides: {
        convertPathData: {
          applyTransforms: false
        }
      }
    }
  ]
}
```
2021-08-13 19:07:08 +03:00
Bogdan Chadkin
316a002299 Remove hasAttr and hasAttrLocal usages (#1447)
In most cases simple check for null is enough.
2021-03-22 01:24:59 +03:00
Bogdan Chadkin
6f2f62c5ee Access attributes directly (#1433)
Got rid from `.attrs`, `.attr()` and `.addAttr()` usages
2021-03-18 18:53:20 +03:00
Bogdan Chadkin
5314c12c99 Convert element children to xast
Ref https://github.com/syntax-tree/xast

Renamed content to children to match xast spec.
2021-03-11 12:29:13 +03:00
Bogdan Chadkin
0e6b0c4a01 Allow empty pattern when any attribute is present 2021-03-06 02:33:19 +03:00
XhmikosR
1310210d4e Use https when possible and fix an inactive domain (#1374) 2021-02-25 13:48:18 +03:00
Bogdan Chadkin
d14315b68f Keep empty <mask> which can hide element by id 2021-02-24 21:13:30 +03:00
Bogdan Chadkin
9263d9ab90 Fix svg spec urls in plugins 2021-02-24 11:18:48 +03:00
Bogdan Chadkin
c1d5f0f7a9 Keep empty <g> when filter attributes is specified 2021-02-23 22:36:47 +03:00
GreLI
c3e0eb6b00 Check for "href’ by local name 2016-03-11 13:31:30 +03:00
GreLI
a7f62d8984 Formatting 2015-06-21 19:13:41 +03:00
Yoshiya Hinosawa
8e6b365c40 Add --show-plugins option 2015-06-07 19:35:49 +09:00
GreLI
d0a5d0e87d Don't remove empty patterns with inheritance 2015-04-12 21:08:34 +03:00
deepsweet
2816424ed7 global refactoring dump 2013-04-09 22:06:27 +03:00
deepsweet
5485010269 'use strict' motherfucker! do you use it?! 2012-11-27 22:51:31 +02:00
deepsweet
bb6323c7f8 more JSHint 2012-11-27 16:53:05 +02:00
deepsweet
ad2e8b4965 plugins/removeEmptyContainers: do not remove an empty 'svg' element (fix #48) 2012-11-23 18:19:33 +04:00
deepsweet
15e4b1a217 plugins/removeUnknownsAndDefaults: remove unknown elements content, attrs and attrs with default values (close #6) 2012-11-22 18:57:43 +02:00
deepsweet
13af2ed95e go! 2012-09-27 14:06:28 +03:00