diff --git a/plugins/cleanupEnableBackground.js b/plugins/cleanupEnableBackground.js index 07c0519a..0769e6cf 100644 --- a/plugins/cleanupEnableBackground.js +++ b/plugins/cleanupEnableBackground.js @@ -1,6 +1,6 @@ 'use strict'; -var regEnableBackground = /^new\s0\s0\s(\d+)\s(\d+)$/, +var regEnableBackground = /^new\s0\s0\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)$/, elems = ['svg', 'mask', 'pattern']; /** @@ -32,7 +32,7 @@ exports.cleanupEnableBackground = function(item) { if (match) { if ( item.attr('width').value === match[1] && - item.attr('height').value === match[2] + item.attr('height').value === match[3] ) { if (item.isElem('svg')) { item.removeAttr('enable-background'); diff --git a/test/plugins/cleanupEnableBackground.01.orig.svg b/test/plugins/cleanupEnableBackground.01.orig.svg index 154f4346..ec2fedac 100644 --- a/test/plugins/cleanupEnableBackground.01.orig.svg +++ b/test/plugins/cleanupEnableBackground.01.orig.svg @@ -1,3 +1,3 @@ - + test diff --git a/test/plugins/cleanupEnableBackground.01.should.svg b/test/plugins/cleanupEnableBackground.01.should.svg index f0c6c5a5..b3634ff7 100644 --- a/test/plugins/cleanupEnableBackground.01.should.svg +++ b/test/plugins/cleanupEnableBackground.01.should.svg @@ -1,3 +1,3 @@ - + test