diff --git a/block.go b/block.go index 8ad21935..d2aec77d 100644 --- a/block.go +++ b/block.go @@ -942,6 +942,7 @@ func (parser *Parser) blockOliPrefix(data []byte) int { // parse ordered or unordered list block func (parser *Parser) blockList(out *bytes.Buffer, data []byte, flags int) int { i := 0 + flags |= LIST_ITEM_BEGINNING_OF_LIST work := func() bool { j := 0 for i < len(data) { @@ -951,6 +952,7 @@ func (parser *Parser) blockList(out *bytes.Buffer, data []byte, flags int) int { if j == 0 || flags&LIST_ITEM_END_OF_LIST != 0 { break } + flags &= ^LIST_ITEM_BEGINNING_OF_LIST } return true } diff --git a/block_test.go b/block_test.go index e6e9f984..888841e4 100644 --- a/block_test.go +++ b/block_test.go @@ -86,10 +86,10 @@ func TestPrefixHeaderNoExtensions(t *testing.T) { "

Hello

\n\n

Header 1

\n\n

Goodbye

\n", "* List\n# Header\n* List\n", - "\n", + "\n", "* List\n#Header\n* List\n", - "\n", + "\n", "* List\n * Nested list\n # Nested header\n", "