1
0
mirror of https://github.com/svg/svgo.git synced 2025-08-09 02:22:08 +03:00

E-notated numbers in paths not recognised (fix #63)

This commit is contained in:
deepsweet
2012-12-06 22:20:25 +02:00
parent 0044611d10
commit bab164e4ca
4 changed files with 11 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
'use strict';
var regNumericValues = /^([\-+]?\d*\.?\d+)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/,
var regNumericValues = /^([\-+]?\d*\.?\d+(\.\d+)?([eE][\-+]?\d+)?)(px|pt|pc|mm|cm|m|in|ft|em|ex|%)?$/,
removeLeadingZero = require('../lib/svgo/tools').removeLeadingZero;
/**
@@ -26,7 +26,7 @@ exports.cleanupNumericValues = function(item, params) {
if (match) {
// round it to the fixed precision
var num = +(+match[1]).toFixed(params.floatPrecision),
units = match[2] || '';
units = match[4] || '';
// and remove leading zero
if (params.leadingZero) {