fixed bug with blank line handling within list items
Russ Ross russ@dixie.edu
Fri, 09 Sep 2011 12:30:45 -0600
2 files changed,
10 insertions(+),
1 deletions(-)
M
block.go
→
block.go
@@ -1079,10 +1079,16 @@ raw.WriteByte('\n')
*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 }
M
block_test.go
→
block_test.go
@@ -396,6 +396,9 @@ "<ul>\n<li><p>List</p>\n\n<pre><code>code block\n</code></pre></li>\n</ul>\n",
"* 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) }