fixed parsing of [disabled] style attribute selectors

This commit is contained in:
cloudhead 2010-02-26 11:29:01 -05:00
parent 7b96181f06
commit c041deacdb

View File

@ -334,13 +334,14 @@ less.parser = {
var attr = '', key, val, op; var attr = '', key, val, op;
if (! $('[')) return; if (! $('[')) return;
if ((key = $(this.tag)) &&
(op = $(/[|~*$^]?=/g)) && if (key = $(/[a-z]+/g) || $(this.entities.string)) {
(val = $(this.entities.string) || $(/[a-zA-Z0-9_-]+/g))) { if ((op = $(/[|~*$^]?=/g)) &&
attr = [key, op, val].join(''); (val = $(this.entities.string) || $(/[\w-]+/g))) {
} else if (val = $(this.tag) || $(this.entities.string)) { attr = [key, op, val].join('');
attr = val; } else { attr = key }
} }
if (! $(']')) return; if (! $(']')) return;
if (attr) { return "[" + attr + "]" } if (attr) { return "[" + attr + "]" }