mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Prevent failure with data set 77 in CommonMarkWeak
This commit is contained in:
parent
2db3199510
commit
0a43799da4
@ -115,7 +115,7 @@ class Parsedown
|
|||||||
# Blocks
|
# Blocks
|
||||||
#
|
#
|
||||||
|
|
||||||
protected function lines(array $lines)
|
protected function lines(array $lines, $parentType = null)
|
||||||
{
|
{
|
||||||
$CurrentBlock = null;
|
$CurrentBlock = null;
|
||||||
|
|
||||||
@ -216,6 +216,12 @@ class Parsedown
|
|||||||
|
|
||||||
$blockTypes = array_merge($highPriority, $blockTypes);
|
$blockTypes = array_merge($highPriority, $blockTypes);
|
||||||
|
|
||||||
|
if ( $parentType === 'List' and ($a = array_search('List', $blockTypes)) !== false and ($b = array_search('Code', $blockTypes)) !== false and $a > $b and ($placeholder = $this->blockList($Line)))
|
||||||
|
{
|
||||||
|
unset($blockTypes[$b]);
|
||||||
|
array_splice($blockTypes, $a + 1, 0, 'Code');
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# ~
|
# ~
|
||||||
|
|
||||||
@ -1502,7 +1508,7 @@ class Parsedown
|
|||||||
|
|
||||||
protected function li($lines)
|
protected function li($lines)
|
||||||
{
|
{
|
||||||
$markup = $this->lines($lines);
|
$markup = $this->lines($lines, 'List');
|
||||||
|
|
||||||
$trimmedMarkup = trim($markup);
|
$trimmedMarkup = trim($markup);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user