diff --git a/block.go b/block.go index af0eb78..8f68954 100644 --- a/block.go +++ b/block.go @@ -1079,10 +1079,16 @@ gatherlines: *flags |= LIST_ITEM_CONTAINS_BLOCK } - containsBlankLine = false + // if this line was preceeded by one or more blanks, + // re-introduce the blank into the buffer + if containsBlankLine { + containsBlankLine = false + raw.WriteByte('\n') + } // add the line into the working buffer without prefix raw.Write(data[line+indent : i]) + line = i } diff --git a/block_test.go b/block_test.go index e169900..75296bd 100644 --- a/block_test.go +++ b/block_test.go @@ -396,6 +396,9 @@ func TestUnorderedList(t *testing.T) { "* List\n\n code block with spaces\n", "
List
\n\n code block with spaces\n
List
\n\nnormal text
\n\n