Is there any way that when optimising SVGs, SVGO would be able to remove the data-name="Layer 1" added to certain elements by Adobe Illustrator?
Thanks!
data-* attrs are being preserved by removeUnknownsAndDefaults plugin by default since it may have some useful data for scripts. But you can turn off keepDataAttrs option in your config. Like this:
plugins:
- removeUnknownsAndDefaults:
keepDataAttrs: false
hi. doesn't work for me...
@Colir can you explain in details? Perhaps, you had wrong config. E.g. had wrong indent in YML, or didn't had plugins key, or an array with plugins in it.
Hi.
I've found the way to do it with the "removeAttrs" plugin with this config in my .yml
- removeAttrs:
elemSeparator: '-'
attrs: 'data.*'
This work well.
Thanks for you
Hadn't noticed this was still open. That should solve the issue. Thanks!
Most helpful comment
data-*attrs are being preserved byremoveUnknownsAndDefaultsplugin by default since it may have some useful data for scripts. But you can turn offkeepDataAttrsoption in your config. Like this: