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:
parent
88854955d6
commit
1017f22cdd
@ -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;
|
||||
}
|
||||
|
12
tests/data/paragraph_list.html
Normal file
12
tests/data/paragraph_list.html
Normal 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>
|
9
tests/data/paragraph_list.md
Normal file
9
tests/data/paragraph_list.md
Normal file
@ -0,0 +1,9 @@
|
||||
paragraph
|
||||
- li
|
||||
- li
|
||||
|
||||
paragraph
|
||||
|
||||
* li
|
||||
|
||||
* li
|
Loading…
x
Reference in New Issue
Block a user