fixed bug with blank line handling within list items

This commit is contained in:
Russ Ross 2011-09-09 12:30:45 -06:00
parent b8bc812a67
commit 583b3c5e1d
2 changed files with 10 additions and 1 deletions

View File

@ -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
}

View File

@ -396,6 +396,9 @@ func TestUnorderedList(t *testing.T) {
"* List\n\n code block with spaces\n",
"<ul>\n<li><p>List</p>\n\n<pre><code> code block with spaces\n</code></pre></li>\n</ul>\n",
"* List\n\n * sublist\n\n normal text\n\n * another sublist\n",
"<ul>\n<li><p>List</p>\n\n<ul>\n<li>sublist</li>\n</ul>\n\n<p>normal text</p>\n\n<ul>\n<li>another sublist</li>\n</ul></li>\n</ul>\n",
}
doTestsBlock(t, tests, 0)
}