Permalink
Browse files

Merge branch 'dev'

  • Loading branch information...
2 parents 74b2372 + 379f5f0 commit 9555bcb13da4ab27a90cda88110a8ed95b21635f @deepsweet deepsweet committed Dec 6, 2012
View
@@ -1,3 +1,8 @@
+### [ [>](https://github.com/svg/svgo/tree/v0.1.5) ] 0.1.5 / 06.12.2012
+* E-notated numbers in paths not recognised (fix [#63](https://github.com/svg/svgo/issues/63))
+* update README with `svgo-grunt` and `svgo-osx-folder-action`
+* fix `mocha-as-promised` plug in node 0.6
+
### [ [>](https://github.com/svg/svgo/tree/v0.1.4) ] 0.1.4 / 05.12.2012
* plugins/_collections: more defaults
* `README.ru.md`
View
@@ -3,7 +3,7 @@
<img src="http://soulshine.in/svgo/logo.svg?v3" width="200" height="200" alt="logo"/>
-## SVGO v0.1.4 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
+## SVGO v0.1.5 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
**SVG O**ptimizer is a Nodejs-based tool for optimizing SVG vector graphics files.
![](//mc.yandex.ru/watch/18431326)
View
@@ -3,7 +3,7 @@
<img src="http://soulshine.in/svgo/logo.svg?v3" width="200" height="200" alt="logo"/>
-## SVGO v0.1.4 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
+## SVGO v0.1.5 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
**SVG** **O**ptimizer – это инструмент для оптимизации векторной графики в формате SVG, написанный на Node.js.
![](//mc.yandex.ru/watch/18431326)
View
@@ -1,6 +1,6 @@
{
"name": "svgo",
- "version": "0.1.4",
+ "version": "0.1.5",
"description": "Nodejs-based tool for optimizing SVG vector graphics files",
"keywords": [ "svgo", "svg", "optimize", "minify" ],
"homepage": "http://svg.github.com/svgo/",
@@ -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) {
@@ -2,7 +2,7 @@
var cleanupOutData = require('../lib/svgo/tools').cleanupOutData,
regPathInstructions = /([MmLlHhVvCcSsQqTtAaZz])\s*/,
- regPathData = /(?=-)|[\s,]+/,
+ regPathData = /[\-+]?\d*\.?\d+(\.\d+)?([eE][\-+]?\d+)?/g,
pathElems = ['path', 'glyph', 'missing-glyph'],
hasMarkerMid;
@@ -73,17 +73,17 @@ function path2js(pathString) {
// data item
} else {
- // M 35.898 14.374 L 35.898 14.374 → M35.898 14.374L35.898 14.374
- data = data.trim().split(regPathData).map(function(str) {
- return +str;
- });
+ data = data.trim().match(regPathData);
- // very stupid defense strategy
- if (typeof data[0] === 'number' && !isNaN(data[0])) {
+ if (data) {
var index = 0,
pair = 2;
+ data = data.map(function(str) {
+ return +str;
+ });
+
// deal with very first 'Mm' and multiple points data
if ('Mm'.indexOf(instruction) > -1) {
@@ -3,6 +3,7 @@
<path d="M 10 50"/>
<path d="M10 50"/>
<path d="M10,50"/>
+ <path d="M10-3.05176e-005"/>
<path d="M 10 , 50"/>
<path d="M -10,-50"/>
<path d="M -10 -50"/>
@@ -3,6 +3,7 @@
<path d="M10 50"/>
<path d="M10 50"/>
<path d="M10 50"/>
+ <path d="M10 0"/>
<path d="M10 50"/>
<path d="M-10-50"/>
<path d="M-10-50"/>

0 comments on commit 9555bcb

Please sign in to comment.