diff --git a/plugins/removeViewBox.js b/plugins/removeViewBox.js index 509d1195..2fbcba4f 100644 --- a/plugins/removeViewBox.js +++ b/plugins/removeViewBox.js @@ -35,6 +35,8 @@ exports.fn = function(item) { var nums = item.attr('viewBox').value.split(/[ ,]+/g); if ( + nums[0] === '0' && + nums[1] === '0' && item.attr('width').value.replace(/px$/, '') === nums[2] && // could use parseFloat too item.attr('height').value.replace(/px$/, '') === nums[3] ) { diff --git a/test/plugins/removeViewBox.04.svg b/test/plugins/removeViewBox.04.svg new file mode 100644 index 00000000..503e93b6 --- /dev/null +++ b/test/plugins/removeViewBox.04.svg @@ -0,0 +1,9 @@ + + test + + +@@@ + + + test +