diff --git a/packages/less/src/less/parser/parser.js b/packages/less/src/less/parser/parser.js index b87b4d762..9b1803f33 100644 --- a/packages/less/src/less/parser/parser.js +++ b/packages/less/src/less/parser/parser.js @@ -2418,7 +2418,7 @@ const Parser = function Parser(context, imports, fileInfo, currentIndex) { do { e = this.comment(); - if (e) { + if (e && !e.isLineComment) { entities.push(e); continue; } diff --git a/packages/test-data/css/_main/variables.css b/packages/test-data/css/_main/variables.css index 3fac8c7f4..6afac9b39 100644 --- a/packages/test-data/css/_main/variables.css +++ b/packages/test-data/css/_main/variables.css @@ -80,3 +80,18 @@ .radio_checked { border-color: #fff; } +div#apple { + color: blue; +} +div#banana { + color: blue; +} +div#cherry { + color: blue; +} +div#carrot { + color: blue; +} +div#potato { + color: blue; +} diff --git a/packages/test-data/less/_main/variables.less b/packages/test-data/less/_main/variables.less index c35ccc5b0..c03d1bff4 100644 --- a/packages/test-data/less/_main/variables.less +++ b/packages/test-data/less/_main/variables.less @@ -143,3 +143,19 @@ .@{radio-cls-checked} { border-color: #fff; } + +@items: +// Fruit + apple, + banana, + cherry, +// Vegetables + carrot, + potato, +; + +each(@items, { + div#@{value} { + color: blue; + } +})