1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

fix paragraph list

This commit is contained in:
Emanuil Rusev 2014-01-18 16:44:38 +02:00
parent 88854955d6
commit 1017f22cdd
3 changed files with 24 additions and 10 deletions

View File

@ -324,8 +324,6 @@ class Parsedown
if ($element['type'] === 'paragraph' and isset($element['interrupted']) === false)
{
$is_heading = true;
$chopped_line = rtrim($line);
$i = 1;
@ -334,19 +332,14 @@ class Parsedown
{
if ($chopped_line[$i] !== $line[0])
{
$is_heading = false;
break;
break 2;
}
$i++;
}
if ($is_heading)
{
$element['type'] = 'heading';
$element['level'] = $line[0] === '-' ? 2 : 1;
}
$element['type'] = 'heading';
$element['level'] = $line[0] === '-' ? 2 : 1;
continue 2;
}

View File

@ -0,0 +1,12 @@
<p>paragraph</p>
<ul>
<li>li</li>
<li>li</li>
</ul>
<p>paragraph</p>
<ul>
<li>
<p>li</p>
</li>
<li>li</li>
</ul>

View File

@ -0,0 +1,9 @@
paragraph
- li
- li
paragraph
* li
* li