File tree 4 files changed +14
-6
lines changed
4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -1140,10 +1140,12 @@ less.Parser = function Parser(env) {
1140
1140
1141
1141
if ( ! $ ( '[' ) ) return ;
1142
1142
1143
- key = expect ( / ^ (?: [ _ A - Z a - z 0 - 9 -\* ] * \| ) ? (?: [ _ A - Z a - z 0 - 9 - ] | \\ .) + / ) ;
1143
+ if ( ! ( key = $ ( this . entities . variableCurly ) ) ) {
1144
+ key = expect ( / ^ (?: [ _ A - Z a - z 0 - 9 -\* ] * \| ) ? (?: [ _ A - Z a - z 0 - 9 - ] | \\ .) + / ) ;
1145
+ }
1144
1146
1145
1147
if ( ( op = $ ( / ^ [ | ~ * $ ^ ] ? = / ) ) ) {
1146
- val = $ ( this . entities . quoted ) || $ ( / ^ [ \w - ] + / ) ;
1148
+ val = $ ( this . entities . quoted ) || $ ( / ^ [ \w - ] + / ) || $ ( this . entities . variableCurly ) ;
1147
1149
}
1148
1150
1149
1151
expect ( ']' ) ;
Original file line number Diff line number Diff line change @@ -45,11 +45,11 @@ tree.Attribute.prototype = {
45
45
this . value = visitor . visit ( this . value ) ;
46
46
} ,
47
47
eval : function ( env ) {
48
- return new ( tree . Attribute ) ( this . key ,
48
+ return new ( tree . Attribute ) ( this . key . eval ? this . key . eval ( env ) : this . key ,
49
49
this . op , ( this . value && this . value . eval ) ? this . value . eval ( env ) : this . value ) ;
50
50
} ,
51
51
toCSS : function ( env ) {
52
- var value = this . key ;
52
+ var value = this . key . toCSS ? this . key . toCSS ( env ) : this . key ;
53
53
54
54
if ( this . op ) {
55
55
value += this . op ;
Original file line number Diff line number Diff line change @@ -133,6 +133,9 @@ p a span {
133
133
[prop *= "val3" ],
134
134
[ |prop ~= "val3" ],
135
135
[* |prop $= "val3" ],
136
- [ns |prop ^= "val3" ] {
136
+ [ns |prop ^= "val3" ],
137
+ [3^= "val3" ],
138
+ [3= 3],
139
+ [3] {
137
140
attributes : yes;
138
141
}
Original file line number Diff line number Diff line change 135
135
[prop*= " val@{num} " ],
136
136
[|prop~= " val@{num} " ],
137
137
[* |prop$= " val@{num} " ],
138
- [ns|prop^= " val@{num} " ] {
138
+ [ns|prop^= " val@{num} " ],
139
+ [@{num} ^= " val@{num} " ],
140
+ [@{num} = @{num} ],
141
+ [@{num} ] {
139
142
attributes: yes;
140
143
}
You can’t perform that action at this time.
0 commit comments