File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 11module . exports = {
22 isInlineComment ( token ) {
3- if ( token [ 0 ] === 'word' && token [ 1 ] === '//' ) {
3+ if ( token [ 0 ] === 'word' && token [ 1 ] . slice ( 0 , 2 ) === '//' ) {
44 const first = token ;
55 const bits = [ ] ;
66 let last ;
Original file line number Diff line number Diff line change @@ -15,6 +15,18 @@ test('inline comment', (t) => {
1515 t . is ( nodeToString ( root ) , less ) ;
1616} ) ;
1717
18+ test ( 'inline comment without leading space' , ( t ) => {
19+ const less = '//batman' ;
20+ const root = parse ( less ) ;
21+ const { first } = root ;
22+
23+ t . truthy ( root ) ;
24+ t . true ( first instanceof Comment ) ;
25+ t . true ( first . inline ) ;
26+ t . is ( first . text , 'batman' ) ;
27+ t . is ( nodeToString ( root ) , less ) ;
28+ } ) ;
29+
1830test ( 'close empty' , ( t ) => {
1931 const less = '// \n//' ;
2032 const root = parse ( less ) ;
You can’t perform that action at this time.
0 commit comments