mirror of
https://github.com/less/less.js.git
synced 2026-04-09 03:00:20 -04:00
Adjust attribute selector regex to allow for numbers and underscores in attribute names (fixes #863, fixes #876).
This commit is contained in:
@@ -542,7 +542,7 @@ less.Parser = function Parser(env) {
|
||||
keyword: function () {
|
||||
var k;
|
||||
|
||||
if (k = $(/^[_A-Za-z-][_A-Za-z0-9-]*/)) {
|
||||
if (k = $(/^[_A-Za-z-][_A-Za-z0-9-]*/)) {
|
||||
if (tree.colors.hasOwnProperty(k)) {
|
||||
// detect named color
|
||||
return new(tree.Color)(tree.colors[k].slice(1));
|
||||
@@ -995,7 +995,7 @@ less.Parser = function Parser(env) {
|
||||
|
||||
if (! $('[')) return;
|
||||
|
||||
if (key = $(/^[a-zA-Z-]+/) || $(this.entities.quoted)) {
|
||||
if (key = $(/^[a-zA-Z0-9_-]+/) || $(this.entities.quoted)) {
|
||||
if ((op = $(/^[|~*$^]?=/)) &&
|
||||
(val = $(this.entities.quoted) || $(/^[\w-]+/))) {
|
||||
attr = [key, op, val.toCSS ? val.toCSS() : val].join('');
|
||||
@@ -1117,7 +1117,7 @@ less.Parser = function Parser(env) {
|
||||
|
||||
mediaFeatures: function () {
|
||||
var e, features = [];
|
||||
|
||||
|
||||
do {
|
||||
if (e = $(this.mediaFeature)) {
|
||||
features.push(e);
|
||||
@@ -1127,7 +1127,7 @@ less.Parser = function Parser(env) {
|
||||
if (! $(',')) { break }
|
||||
}
|
||||
} while (e);
|
||||
|
||||
|
||||
return features.length > 0 ? features : null;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user