From c041deacdb43c3aea5b79d6e4e72006fcd60c1cb Mon Sep 17 00:00:00 2001 From: cloudhead Date: Fri, 26 Feb 2010 11:29:01 -0500 Subject: [PATCH] fixed parsing of `[disabled]` style attribute selectors --- lib/less/parser.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/less/parser.js b/lib/less/parser.js index d24bfc2..efe4106 100644 --- a/lib/less/parser.js +++ b/lib/less/parser.js @@ -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 + "]" }