Skip to content

Commit

Permalink
plugins/removeUnknownsAndDefaults: remove SVG id attr (close svg#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsweet committed Nov 23, 2012
1 parent d35cec2 commit 088548d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .svgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ plugins:
active: true
type: perItem
params:
SVGid: true
unknownContent: true
unknownAttrs: true
defaultAttrs: true
Expand Down
5 changes: 5 additions & 0 deletions plugins/removeUnknownsAndDefaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ exports.removeUnknownsAndDefaults = function(item, params) {

var elem = item.elem;

// remove SVG id attr
if (params.SVGid && elem === 'svg') {
item.removeAttr('id');
}

// remove unknown element's content
if (
params.unknownContent &&
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/removeUnknownsAndDefaults.02.orig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 088548d

Please sign in to comment.