Merge pull request #475 from aidantwoods/loose-lists

Loose lists
This commit is contained in:
Aidan Woods 2018-02-28 17:05:00 +00:00 committed by GitHub
commit 5057e505d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 4 deletions

View File

@ -569,6 +569,8 @@ class Parsedown
{
$Block['li']['text'] []= '';
$Block['loose'] = true;
unset($Block['interrupted']);
}
@ -617,6 +619,22 @@ class Parsedown
}
}
protected function blockListComplete(array $Block)
{
if (isset($Block['loose']))
{
foreach ($Block['element']['text'] as &$li)
{
if (end($li['text']) !== '')
{
$li['text'] []= '';
}
}
}
return $Block;
}
#
# Quote

View File

@ -0,0 +1,10 @@
<ol>
<li>
<p>One
First body copy</p>
</li>
<li>
<p>Two
Last body copy</p>
</li>
</ol>

View File

@ -0,0 +1,5 @@
1. One
First body copy
2. Two
Last body copy

View File

@ -8,5 +8,7 @@
<li>
<p>li</p>
</li>
<li>li</li>
<li>
<p>li</p>
</li>
</ul>

View File

@ -2,6 +2,10 @@
<li>
<p>li</p>
</li>
<li>li</li>
<li>li</li>
<li>
<p>li</p>
</li>
<li>
<p>li</p>
</li>
</ul>

View File

@ -2,7 +2,9 @@
<li>
<p>li</p>
</li>
<li>li</li>
<li>
<p>li</p>
</li>
</ul>
<hr />
<ul>