Skip to content
This repository
Browse code

#23 Path component string should be trimmed before processing

  • Loading branch information...
commit aabe3c9d45f7e39e44f762821c746e524ecf0b0b 1 parent b5d6bb3
Kirill Lebedev authored

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. +4 1 lib/vml-path-element.js
5 lib/vml-path-element.js
@@ -28,7 +28,10 @@ jvm.VMLPathElement.pathSvgToVml = function(path) {
28 28
29 29 path = path.replace(/(-?\d+)e(-?\d+)/g, '0');
30 30 return path.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g, function(segment, letter, coords, index){
31   - coords = coords.replace(/(\d)-/g, '$1,-').replace(/\s+/g, ',').split(',');
  31 + coords = coords.replace(/(\d)-/g, '$1,-')
  32 + .replace(/^\s+/g, '')
  33 + .replace(/\s+$/g, '')
  34 + .replace(/\s+/g, ',').split(',');
32 35 if (!coords[0]) coords.shift();
33 36 for (var i=0, l=coords.length; i<l; i++) {
34 37 coords[i] = Math.round(100*coords[i]);

0 comments on commit aabe3c9

Please sign in to comment.
Something went wrong with that request. Please try again.