Skip to content

Commit 5497365

Browse files
committed
fix: fill rule with a regexp
1 parent 1ab09f6 commit 5497365

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

utils/svg.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ const removeUnnecessaryAttrs = ($) => {
2828
const normalize = (file) => {
2929
const $ = removeUnnecessaryAttrs(load(file));
3030

31-
return $.html()
32-
.replace('fill-rule', 'fillRule')
33-
.replace('xlink:href', 'xlinkHref');
31+
const html = $.html()
32+
.replace(new RegExp('fill-rule', 'g'), 'fillRule')
33+
.replace(new RegExp('xlink:href', 'g'), 'xlinkHref')
34+
35+
console.log(html);
36+
37+
return html;
3438
};
3539

3640
exports.minify = () => through((file, enc, cb) =>

0 commit comments

Comments
 (0)