mirror of
https://github.com/danog/blackfriday.git
synced 2024-12-02 09:27:49 +01:00
Merge pull request #261 from moorereason/iss235
Fix adjacent list merging
This commit is contained in:
commit
43529be397
7
block.go
7
block.go
@ -1174,6 +1174,13 @@ gatherlines:
|
||||
p.dliPrefix(chunk) > 0:
|
||||
|
||||
if containsBlankLine {
|
||||
// end the list if the type changed after a blank line
|
||||
if (*flags&LIST_TYPE_ORDERED != 0 && p.uliPrefix(chunk) > 0) ||
|
||||
(*flags&LIST_TYPE_ORDERED == 0 && p.oliPrefix(chunk) > 0) {
|
||||
|
||||
*flags |= LIST_ITEM_END_OF_LIST
|
||||
break gatherlines
|
||||
}
|
||||
*flags |= LIST_ITEM_CONTAINS_BLOCK
|
||||
}
|
||||
|
||||
|
@ -657,6 +657,9 @@ func TestUnorderedList(t *testing.T) {
|
||||
"Paragraph\n\n* Linebreak\n",
|
||||
"<p>Paragraph</p>\n\n<ul>\n<li>Linebreak</li>\n</ul>\n",
|
||||
|
||||
"* List\n\n1. Spacer Mixed listing\n",
|
||||
"<ul>\n<li>List</li>\n</ul>\n\n<ol>\n<li>Spacer Mixed listing</li>\n</ol>\n",
|
||||
|
||||
"* List\n * Nested list\n",
|
||||
"<ul>\n<li>List\n\n<ul>\n<li>Nested list</li>\n</ul></li>\n</ul>\n",
|
||||
|
||||
@ -815,6 +818,12 @@ func TestOrderedList(t *testing.T) {
|
||||
"1. List\n\n code block with spaces\n",
|
||||
"<ol>\n<li><p>List</p>\n\n<pre><code> code block with spaces\n</code></pre></li>\n</ol>\n",
|
||||
|
||||
"1. List\n\n* Spacer Mixed listing\n",
|
||||
"<ol>\n<li>List</li>\n</ol>\n\n<ul>\n<li>Spacer Mixed listing</li>\n</ul>\n",
|
||||
|
||||
"1. List\n* Mixed listing\n",
|
||||
"<ol>\n<li>List</li>\n<li>Mixed listing</li>\n</ol>\n",
|
||||
|
||||
"1. List\n * Mixted list\n",
|
||||
"<ol>\n<li>List\n\n<ul>\n<li>Mixted list</li>\n</ul></li>\n</ol>\n",
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user