File tree 2 files changed +33
-1
lines changed 2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ function flow(parent, context) {
22
22
if ( next ) {
23
23
if (
24
24
child . type === 'list' &&
25
- ( formatCodeAsIndented ( next , context ) ||
25
+ ( ( next . type === 'code' && formatCodeAsIndented ( next , context ) ) ||
26
26
( child . type === next . type &&
27
27
Boolean ( child . ordered ) === Boolean ( next . ordered ) ) )
28
28
) {
Original file line number Diff line number Diff line change @@ -2490,5 +2490,37 @@ test('roundtrip', function (t) {
2490
2490
2491
2491
t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip potential prototype injections' )
2492
2492
2493
+ doc = [
2494
+ '* foo' ,
2495
+ '*' ,
2496
+ '* bar' ,
2497
+ '' ,
2498
+ '* baz' ,
2499
+ '*' ,
2500
+ '* qux quux' ,
2501
+ ''
2502
+ ] . join ( '\n' )
2503
+
2504
+ doc = [
2505
+ '* foo' ,
2506
+ '' ,
2507
+ '*' ,
2508
+ '' ,
2509
+ '* bar' ,
2510
+ '' ,
2511
+ '* baz' ,
2512
+ '' ,
2513
+ '*' ,
2514
+ '' ,
2515
+ '* qux quux' ,
2516
+ ''
2517
+ ] . join ( '\n' )
2518
+
2519
+ t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip empty lists' )
2520
+
2521
+ doc = '* a\n\n<!---->\n\n* b\n'
2522
+
2523
+ t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip lists with break comments' )
2524
+
2493
2525
t . end ( )
2494
2526
} )
You can’t perform that action at this time.
0 commit comments