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

22 Commits

Author SHA1 Message Date
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
4cacd9e676
Migrate ast traversing into xast module (#1434)
Replaced JSAPI methods with new utilities

- querySelectorAll(node, selector)
- querySelector(node, selector)
- matches(node, selector)
- closestByName(node, elementName)
- traverse(node, fn)

New traverse replaced many in-place implementations.
2021-03-19 11:06:41 +03:00
Bogdan Chadkin
07928fc77e
Replace removeAttr with delete operator (#1432)
delete operator is more explicit and not much harder to use.
2021-03-17 21:40:06 +03:00
Bogdan Chadkin
28c01cfe65 Preverve viewBox in nested <svg> 2021-03-06 13:39:31 +03:00
XhmikosR
1310210d4e
Use https when possible and fix an inactive domain (#1374) 2021-02-25 13:48:18 +03:00
Bogdan Chadkin
9263d9ab90 Fix svg spec urls in plugins 2021-02-24 11:18:48 +03:00
GreLI
f067ea996f Fix removeViewBox to check for zero start coordinates. Fixes #832 2017-11-08 22:04:42 +03:00
GreLI
055e303607 Tune plugins 2017-10-22 19:32:24 +03:00
caub
5828949c21 round viewBox too 2017-06-10 12:33:59 +02:00
GreLI
faabeff4f4 Parse commas in viewBox 2017-03-25 22:06:15 +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
Kir Belevich
da04c47260 disable removeViewBox by default (fix #139) 2014-01-14 16:17:23 +02:00
deepsweet
2816424ed7 global refactoring dump 2013-04-09 22:06:27 +03:00
deepsweet
5e5cb1aecc plugins/removeViewBox doesn't catch floating-point numbers (fix #88) 2013-01-18 15:35:20 +02: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
43d716296a JSHint :-| 2012-10-12 22:36:12 +03:00
deepsweet
a35f74affd plugins/removeViewBox: fix global scope leak 2012-10-02 15:48:59 +04:00
deepsweet
ce15a78abe plugins/removeViewBox: more strict logic 2012-10-02 15:47:27 +04:00
deepsweet
d4b0fe3546 update some jsdoc with examples 2012-09-30 01:17:59 +04:00
deepsweet
5ac7d69342 new plugin removeViewBox 2012-09-29 17:35:51 +04:00