Seth Falco
a9df915d1d
fix: dont trim pre elements ( #1796 )
...
Includes pre in the array of text elements in _collections.js so that we don't trim whitespace on them, which effects rendering.
2023-11-12 11:56:39 +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
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
Bogdan Chadkin
7ec255719c
Refactor adhoc plugins with visitor api ( #1526 )
...
- addAttributesToSVGElement
- addClassesToSVGElement
- removeAttributesBySelector
- removeAttrs
- removeElementsByAttr
2021-08-14 16:48:39 +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
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
00ec0f71fe
Format all plugins with prettier
2021-03-09 19:58:00 +03:00
Bradley Mease
b4bd5d52e3
Add removeAttributesBySelector plugin ( #929 )
...
* Add removeAttributesBySelector plugin
Removes attributes of elements that match a css selector.
2019-02-24 20:07:38 +03:00