diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-11-18 01:16:41 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2015-11-18 01:16:41 +0100 |
commit | cf783fca1213d26b50bc07af0ca7e2b0f6385401 (patch) | |
tree | 4e619e160e7889d7c9c9abd9d8d4c7617d3c8f43 /src/regex.js | |
parent | 7af9d16adff245c987eaed5ccac40f4d2824d2f3 (diff) | |
download | svg.js-cf783fca1213d26b50bc07af0ca7e2b0f6385401.tar.gz svg.js-cf783fca1213d26b50bc07af0ca7e2b0f6385401.zip |
`SvgPathSeg` is removed in Chrome 48. Added workaround (fixes #409)
Diffstat (limited to 'src/regex.js')
-rw-r--r-- | src/regex.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/regex.js b/src/regex.js index a6ffb98..1b26afd 100644 --- a/src/regex.js +++ b/src/regex.js @@ -42,4 +42,26 @@ SVG.regex = { // Test for image url , isImage: /\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i + // The following regex are used to parse the d attribute of a path + + // Replaces all negative exponents +, negExp: /e\-/gi + + // Replaces all comma +, comma: /,/g + + // Replaces all hyphens +, hyphen: /\-/g + + // Replaces and tests for all path letters +, pathLetters: /[MLHVCSQTAZ]/gi + + // yes we need this one, too +, isPathLetter: /[MLHVCSQTAZ]/i + + // split at whitespaces +, whitespaces: /\s+/ + + // matches X +, X: /X/g }
\ No newline at end of file |