diff --git a/block.go b/block.go index 740ad46..f9ce9e3 100644 --- a/block.go +++ b/block.go @@ -1174,6 +1174,13 @@ gatherlines: p.dliPrefix(chunk) > 0: if containsBlankLine { + // end the list if the type changed after a blank line + if (*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) || + (*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0) { + + *flags |= LIST_ITEM_END_OF_LIST + break gatherlines + } *flags |= LIST_ITEM_CONTAINS_BLOCK } diff --git a/block_test.go b/block_test.go index f59268e..bb3a50b 100644 --- a/block_test.go +++ b/block_test.go @@ -657,6 +657,9 @@ func TestUnorderedList(t *testing.T) { "Paragraph\n\n* Linebreak\n", "
Paragraph
\n\nList
\n\n code block with spaces\n