all repos — grayfriday @ 583b3c5e1dcb22f284b040675c11024081a4a66c

blackfriday fork with a few changes

fixed bug with blank line handling within list items
Russ Ross russ@dixie.edu
Fri, 09 Sep 2011 12:30:45 -0600
commit

583b3c5e1dcb22f284b040675c11024081a4a66c

parent

b8bc812a67d11f80ea7ff91d930cdae712c4ddb5

2 files changed, 10 insertions(+), 1 deletions(-)

jump to
M block.goblock.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.goblock_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) }