mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08:00
fixed bug with blank line handling within list items
This commit is contained in:
parent
b8bc812a67
commit
583b3c5e1d
8
block.go
8
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
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user