File tree Expand file tree Collapse file tree 3 files changed +32
-5
lines changed
packages/micromark-util-subtokenize/dev Expand file tree Collapse file tree 3 files changed +32
-5
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -109,7 +109,10 @@ export function subtokenize(eventsArray) {
109109 otherEvent [ 1 ] . type = types . lineEnding
110110 lineIndex = otherIndex
111111 }
112- } else if ( otherEvent [ 1 ] . type === types . linePrefix ) {
112+ } else if (
113+ otherEvent [ 1 ] . type === types . linePrefix ||
114+ otherEvent [ 1 ] . type === types . listItemIndent
115+ ) {
113116 // Move past.
114117 } else {
115118 break
Original file line number Diff line number Diff line change @@ -795,6 +795,34 @@ test('list-item', async function (t) {
795795 }
796796 )
797797
798+ await t . test ( 'should ignore trailing whitespace (1)' , async function ( ) {
799+ assert . equal (
800+ micromark ( '* a\n* b\n\n\n' ) ,
801+ '<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n'
802+ )
803+ } )
804+
805+ await t . test ( 'should ignore trailing whitespace (2)' , async function ( ) {
806+ assert . equal (
807+ micromark ( '* a\n* b\n \n\n' ) ,
808+ '<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n'
809+ )
810+ } )
811+
812+ await t . test ( 'should ignore trailing whitespace (3)' , async function ( ) {
813+ assert . equal (
814+ micromark ( '* a\n* b\n\n \n' ) ,
815+ '<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n'
816+ )
817+ } )
818+
819+ await t . test ( 'should ignore trailing whitespace (4)' , async function ( ) {
820+ assert . equal (
821+ micromark ( '* a\n* b\n \n \n' ) ,
822+ '<ul>\n<li>a</li>\n<li>b</li>\n</ul>\n'
823+ )
824+ } )
825+
798826 await t . test ( 'should support turning off lists' , async function ( ) {
799827 assert . equal (
800828 micromark ( '- one\n\n two' , { extensions : [ { disable : { null : [ 'list' ] } } ] } ) ,
You can’t perform that action at this time.
0 commit comments