diff --git a/block.go b/block.go index 7fb472e..740ad46 100644 --- a/block.go +++ b/block.go @@ -1153,6 +1153,7 @@ gatherlines: // and move on to the next line if p.isEmpty(data[line:i]) > 0 { containsBlankLine = true + raw.Write(data[line:i]) line = i continue } @@ -1220,17 +1221,10 @@ gatherlines: // a blank line means this should be parsed as a block case containsBlankLine: - raw.WriteByte('\n') *flags |= LIST_ITEM_CONTAINS_BLOCK } - // if this line was preceeded by one or more blanks, - // re-introduce the blank into the buffer - if containsBlankLine { - containsBlankLine = false - raw.WriteByte('\n') - - } + containsBlankLine = false // add the line into the working buffer without prefix raw.Write(data[line+indent : i]) diff --git a/block_test.go b/block_test.go index 60da6ca..f59268e 100644 --- a/block_test.go +++ b/block_test.go @@ -702,10 +702,41 @@ func TestUnorderedList(t *testing.T) { "* List\n\n * sublist\n\n normal text\n\n * another sublist\n", "
List
\n\nnormal text
\n\nFoo
+ +bar
+
+qux
+Foo
+ +bar
+
+qux
+Foo
+ +bar
+
+
+
+qux
+