File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -316,8 +316,8 @@ export default class LessParser extends Parser {
316316 }
317317 }
318318
319- // we don't want to add params for pseudo-selectors that utilize parens (#56)
320- if ( ( extend || ! colon ) && ( brackets . length > 0 || type === 'brackets' || params [ 0 ] ) ) {
319+ // we don't want to add params for pseudo-selectors that utilize parens (#56) or bracket selectors (#96)
320+ if ( ( extend || ! colon ) && ( brackets . length > 0 || type === 'brackets' || params [ 0 ] ) && brackets [ 0 ] !== ']' ) {
321321 params . push ( token ) ;
322322 }
323323
Original file line number Diff line number Diff line change @@ -15,5 +15,13 @@ describe('Parser', () => {
1515 expect ( root . first . params ) . to . be . undefined ;
1616 } ) ;
1717
18+ it ( 'should not assign parameters for bracket selectors' , ( ) => {
19+ const code = '.test1,.test2[test=test] {}' ;
20+ const root = parse ( code ) ;
21+
22+ expect ( root . first . selector ) . to . eql ( '.test1,.test2[test=test]' ) ;
23+ expect ( root . first . params ) . to . be . undefined ;
24+ } ) ;
25+
1826 } ) ;
1927} ) ;
You can’t perform that action at this time.
0 commit comments