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

18 Commits

Author SHA1 Message Date
XhmikosR
b41c6fe473
removeUselessStrokeAndFill.js: use String.startsWith() (#1522) 2021-08-14 13:09:57 +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
6f2f62c5ee
Access attributes directly (#1433)
Got rid from `.attrs`, `.attr()` and `.addAttr()` usages
2021-03-18 18:53:20 +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
8098ab7fb6
Replace attributes iterators with for/of (#1431)
These iterators allows to directly manipulate passed value
which does not let us to get rid from legacy "attrs" field.

Object.entries makes it easier to get an access to both attribute
name and value.
2021-03-17 12:50:16 +03:00
Bogdan Chadkin
d1d6e5efe8
Remove prefix/local support in elements and attributes (#1413)
These parts of element and attribute name are easy to extract.
Now we can easily replace attrs with xast attributes object.
2021-03-10 13:26:15 +03:00
Bogdan Chadkin
00ec0f71fe Format all plugins with prettier 2021-03-09 19:58:00 +03:00
Bogdan Chadkin
36391564f2 Preserve stroke-width when marker-end is specified 2021-02-24 17:29:29 +03:00
caub
bcd908691f fix for hasStyleOrScript, it must be initialized with SVGO constructor, not global, else it'll keep previous run value 2017-02-25 21:38:50 +01:00
caub
5a1693bd5e additional option for removeUselessFillStroke, to actually remove invisible shapes 2017-02-17 01:29:19 +01: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
cf37722e29 Disable removeUselessStrokeAndFill if there is a <style> or <script> 2015-03-29 21:27:52 +03:00
GreLI
d3e4f63ae5 removeUselessStrokeAndFill is back. Checks for inherited attrs and references. 2015-02-23 23:06:18 +03:00
GreLI
84f105b76b Disabled removeUselessStrokeAndFill due to problems with inheritance 2014-11-04 22:31:33 +03:00
deepsweet
93fc2616d1 plugins/removeUselessStrokeAndFill: fix a typo 2013-04-11 20:28:49 +03:00
deepsweet
2816424ed7 global refactoring dump 2013-04-09 22:06:27 +03:00
deepsweet
db9188562f new plugin: remove useless 'stroke' and 'fill' attrs (close #75) 2012-12-11 17:26:47 +02:00