mirror of
https://github.com/less/less.js.git
synced 2026-02-06 21:15:14 -05:00
Fix comments test
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user