Fix #861 and introduce tests for errors

This commit is contained in:
Luke Page
2012-08-11 12:00:15 +01:00
parent be8a23923b
commit b809e8eeb2
4 changed files with 33 additions and 0 deletions

View File

@@ -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();
},
//