Svgo: [REQUEST] Remove data-name="Layer 1" from SVGs

Created on 22 Sep 2017  路  5Comments  路  Source: svg/svgo

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!

Most helpful comment

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

All 5 comments

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!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdkjones picture bdkjones  路  3Comments

bmcminn picture bmcminn  路  4Comments

Roman52 picture Roman52  路  5Comments

niftylettuce picture niftylettuce  路  4Comments

ai picture ai  路  5Comments