mirror of
https://github.com/less/less.js.git
synced 2026-02-09 22:45:28 -05:00
Fix #861 and introduce tests for errors
This commit is contained in:
@@ -780,6 +780,8 @@ less.Parser = function Parser(env) {
|
||||
var elements = [], e, c, args = [], arg, index = i, s = input.charAt(i), name, value, important = false;
|
||||
|
||||
if (s !== '.' && s !== '#') { return }
|
||||
|
||||
save(); // stop us absorbing part of an invalid selector
|
||||
|
||||
while (e = $(/^[#.](?:[\w-]|\\(?:[A-Fa-f0-9]{1,6} ?|[^A-Fa-f0-9]))+/)) {
|
||||
elements.push(new(tree.Element)(c, e, i));
|
||||
@@ -818,6 +820,8 @@ less.Parser = function Parser(env) {
|
||||
if (elements.length > 0 && ($(';') || peek('}'))) {
|
||||
return new(tree.mixin.Call)(elements, args, index, env.filename, important);
|
||||
}
|
||||
|
||||
restore();
|
||||
},
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user