Added case insensitive units handling. Issue #2096

This commit is contained in:
jurcovicovam
2014-09-05 10:04:38 +02:00
parent f16cc89570
commit cbc8c78625
4 changed files with 6 additions and 2 deletions

View File

@@ -981,7 +981,7 @@ less.Parser = function Parser(env) {
return;
}
value = $re(/^([+-]?\d*\.?\d+)(%|[a-z]+)?/);
value = $re(/^([+-]?\d*\.?\d+)(%|[a-zA-Z]+)?/);
if (value) {
return new(tree.Dimension)(value[1], value[2]);
}

View File

@@ -224,7 +224,7 @@ tree.Unit.prototype = {
},
is: function (unitString) {
return this.toString() === unitString;
return this.toString().toUpperCase() === unitString.toUpperCase();
},
isLength: function () {