Svgo: removeAttrs not working at all

Created on 16 Jun 2016  路  3Comments  路  Source: svg/svgo

plugins:  
  - removeAttrs: 
    - attrs: 'fill'

input

<svg>
  <path fill="#f00" d="M4 4h24v24h-24z"></path>
</svg>

output

<svg>
  <path fill="#f00" d="M4 4h24v24h-24z"></path>
</svg>

expected output

<svg>
  <path d="M4 4h24v24h-24z"></path>
</svg>

I tested the config file with other plugins and they work separately and in combiation with this one, though removeAttrs does no change the code in any way

Most helpful comment

I had the same problem.

The yml should be:

plugins:  
  - removeAttrs: 
      attrs: 'fill'

All 3 comments

I had the same problem.

The yml should be:

plugins:  
  - removeAttrs: 
      attrs: 'fill'

@jonrimmer thx.

Not sure why people can't just agree upon using json for settings. It would probably solve/prevent a lot of issues

Since nobody ever responded to this issue I actually built my own parser to handle issues that svgo has.

Closing this for now.

Actually, one can use json. It was json initially and will be correctly parsed now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdkjones picture bdkjones  路  3Comments

onlymega picture onlymega  路  6Comments

bmcminn picture bmcminn  路  4Comments

ai picture ai  路  5Comments

pixelass picture pixelass  路  6Comments