Skip to content

Commit

Permalink
Fix measurement regex's to allow for multiple digits before decimal p…
Browse files Browse the repository at this point in the history
…oint

- fixes #27 Thanks @lalalic
  • Loading branch information
chad3814 committed Apr 22, 2015
1 parent dcd687f commit ef912ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/parsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ exports.TYPES = {
// rough regular expressions
var integerRegEx = /^[\-+]?[0-9]+$/;
var numberRegEx = /^[\-+]?[0-9]*\.[0-9]+$/;
var lengthRegEx = /^(0|[\-+]?[0-9]?\.?[0-9]+(in|cm|em|mm|pt|pc|px))$/;
var percentRegEx = /^[\-+]?[0-9]?\.?[0-9]+%$/;
var lengthRegEx = /^(0|[\-+]?[0-9]*\.?[0-9]+(in|cm|em|mm|pt|pc|px))$/;
var percentRegEx = /^[\-+]?[0-9]*\.?[0-9]+%$/;
var urlRegEx = /^url\(\s*([^\)]*)\s*\)$/;
var stringRegEx = /^("[^"]*"|'[^']*')$/;
var colorRegEx1 = /^#[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F]([0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])?$/;
var colorRegEx2 = /^rgb\(([^\)]*)\)$/;
var colorRegEx3 = /^rgba\(([^\)]*)\)$/;
var angleRegEx = /^([\-+]?[0-9]?\.?[0-9]+)(deg|grad|rad)$/;
var angleRegEx = /^([\-+]?[0-9]*\.?[0-9]+)(deg|grad|rad)$/;
/*jslint regexp: false*/

// This will return one of the above types based on the passed in string
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "cssstyle",
"description": "CSSStyleDeclaration Object Model implementation",
"keywords": ["CSS", "CSSStyleDeclaration", "StyleSheet"],
"version": "0.2.22",
"version": "0.2.24",
"homepage": "https://github.com/chad3814/CSSStyleDeclaration",
"maintainers": [{
"name": "Chad Walker",
Expand Down

0 comments on commit ef912ac

Please sign in to comment.