Skip to content

Commit

Permalink
fix(ic): fix prefix: "xlink" error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Apr 16, 2023
1 parent 2c4e70a commit 43f557d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
16 changes: 13 additions & 3 deletions icons/ic/svgo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ module.exports = {
pretty: true, // boolean, false by default
},
plugins: [
'removeXMLNS',
'convertColors',
'reusePaths',
{
name: "removeAttrs",
params: {
attrs: "(stroke-linejoin|block-progression)"
attrs: "(stroke-linejoin|block-progression|xlinkHref)"
}
},
{
Expand All @@ -24,7 +24,17 @@ module.exports = {
delete ast.children[0]?.attributes['version'];
delete ast.children[0]?.attributes['style'];
delete ast.children[0]?.attributes['xml:space'];
delete ast.children[0]?.attributes['xmlns:xlink'];
ast.children[0]?.children.forEach((item) => {
if (item.name === 'a') {
ast.children[0].children = [...item.children];
}
if (item.name === 'path') {
const str = item.attributes['style'];
if (str) {
item.attributes['style'] = str.replace(/block-progression:tb;-inkscape-font-specification:Sans/g, ``);
}
}
});
},
}
]
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"lerna": "^6.0.0",
"lint-staged": "^13.0.3",
"prettier": "^2.7.1",
"tsbb": "^4.0.3"
"tsbb": "^4.1.5"
}
}

0 comments on commit 43f557d

Please sign in to comment.