1
0
mirror of https://github.com/svg/svgo.git synced 2025-07-29 20:21:14 +03:00

Parse commas in viewBox

This commit is contained in:
GreLI
2017-03-25 22:06:15 +03:00
parent 0bc82faaf8
commit faabeff4f4
2 changed files with 10 additions and 1 deletions

View File

@ -6,7 +6,7 @@ exports.active = false;
exports.description = 'removes viewBox attribute when possible (disabled by default)';
var regViewBox = /^0\s0\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)\s([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)$/,
var regViewBox = /^0\s*[,\s]\s*0\s*[,\s]\s*([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)\s*[,\s]\s*([\-+]?\d*\.?\d+([eE][\-+]?\d+)?)$/,
viewBoxElems = ['svg', 'pattern'];
/**

View File

@ -0,0 +1,9 @@
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="50" viewBox="0, 0, 100, 50">
test
</svg>
@@@
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="50">
test
</svg>

After

Width:  |  Height:  |  Size: 192 B