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;
if (! $('[')) return;
if ((key = $(this.tag)) &&
(op = $(/[|~*$^]?=/g)) &&
(val = $(this.entities.string) || $(/[a-zA-Z0-9_-]+/g))) {
attr = [key, op, val].join('');
} else if (val = $(this.tag) || $(this.entities.string)) {
attr = val;
if (key = $(/[a-z]+/g) || $(this.entities.string)) {
if ((op = $(/[|~*$^]?=/g)) &&
(val = $(this.entities.string) || $(/[\w-]+/g))) {
attr = [key, op, val].join('');
} else { attr = key }
}
if (! $(']')) return;
if (attr) { return "[" + attr + "]" }