File tree Expand file tree Collapse file tree 2 files changed +33
-1
lines changed Expand file tree Collapse file tree 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) {
2222 if ( next ) {
2323 if (
2424 child . type === 'list' &&
25- ( formatCodeAsIndented ( next , context ) ||
25+ ( ( next . type === 'code' && formatCodeAsIndented ( next , context ) ) ||
2626 ( child . type === next . type &&
2727 Boolean ( child . ordered ) === Boolean ( next . ordered ) ) )
2828 ) {
Original file line number Diff line number Diff line change @@ -2490,5 +2490,37 @@ test('roundtrip', function (t) {
24902490
24912491 t . equal ( to ( from ( doc ) ) , doc , 'should roundtrip potential prototype injections' )
24922492
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+
24932525 t . end ( )
24942526} )
You can’t perform that action at this time.
0 commit comments