diff --git a/lib/less/parser.js b/lib/less/parser.js index 24b9212f..6ae052c1 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -832,6 +832,7 @@ less.Parser = function Parser(env) { expressions = []; while (arg = $(this.expression)) { nameLoop = null; + arg.throwAwayComments(); value = arg; // Variable @@ -1470,7 +1471,8 @@ less.Parser = function Parser(env) { while (e = $(this.addition) || $(this.entity)) { entities.push(e); - if (!peek(/^\/\*/) && (delim = $('/'))) { + // operations do not allow keyword "/" dimension (e.g. small/20px) so we support that here + if (!peek(/^\/[\/*]/) && (delim = $('/'))) { entities.push(new(tree.Anonymous)(delim)); } } diff --git a/lib/less/tree/expression.js b/lib/less/tree/expression.js index 762db055..e6e970f4 100644 --- a/lib/less/tree/expression.js +++ b/lib/less/tree/expression.js @@ -29,6 +29,11 @@ tree.Expression.prototype = { return this.value.map(function (e) { return e.toCSS ? e.toCSS(env) : ''; }).join(' '); + }, + throwAwayComments: function () { + this.value = this.value.filter(function(v) { + return !(v instanceof tree.Comment); + }); } }; diff --git a/test/less/comments.less b/test/less/comments.less index 85007c44..4aa2b8f1 100644 --- a/test/less/comments.less +++ b/test/less/comments.less @@ -58,7 +58,7 @@ .selector /* .with */, .lots, /* of */ .comments { color: grey, /* blue */ orange; -webkit-border-radius: 2px /* webkit only */; - -moz-border-radius: 2px * 4 /* moz only with operation */; + -moz-border-radius: (2px * 4) /* moz only with operation */; } .mixin_def_with_colors(@a: white, // in