1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-06 04:02:31 +03:00
Commit Graph

13 Commits

Author SHA1 Message Date
9b8f13e911 Add plugin types (#1527)
Covered following plugins
- addAttributesToSVGElement.js 
- addClassesToSVGElement.js 
- cleanupAttrs.js 
- convertEllipseToCircle.js 
- removeAttributesBySelector.js 
- removeAttrs.js 
- removeComments.js 
- removeDesc.js 
- removeDoctype.js 
- removeElementsByAttr.js 
- removeEmptyText.js 
- removeMetadata.js 
- removeRasterImages.js 
- removeScriptElement.js 
- removeStyleElement.js 
- removeTitle.js 
- removeXMLProcInst.js
2021-08-15 13:52:41 +03:00
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
f00bd727b0 Refactor basic plugins with visitor api (#1518)
- cleanupAttrs
- convertEllipseToCircle
- removeDesc
- removeDoctype
- removeEmptyText
- removeMetadata
- removeRasterImages
- removeScriptElement
- removeStyleElement
- removeTitle
- removeXMLProcInst
2021-08-12 14:57:36 +03:00
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
c50decb438 Convert cdata and text nodes to xast
Ref https://github.com/syntax-tree/xast

More consistent naming and distinction by type looks a bit cleaner.
2021-03-10 16:16:11 +03:00
00ec0f71fe Format all plugins with prettier 2021-03-09 19:58:00 +03:00
f03d832838 Update readme to sync with actual state 2017-11-03 12:54:36 +03:00
055e303607 Tune plugins 2017-10-22 19:32:24 +03:00
cbaefd8dcb Update removeDesc.js (#798)
Expand default config to remove <desc> tags that start with "Created using" (in addition to "Created with").

Change is due to Figma using "Created using Figma" as their default SVG description. Sketch and others use "Created with Sketch.".
2017-09-22 21:22:46 +03:00
a7f62d8984 Formatting 2015-06-21 19:13:41 +03:00
8e6b365c40 Add --show-plugins option 2015-06-07 19:35:49 +09:00
9b8250d6c4 Remove standard descriptions. Resolves #302 2015-03-22 18:12:09 +03:00
06f084d8e7 added removeDesc plugin 2014-09-26 10:17:51 -07:00