mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Revert "Break less previously passed CommonMarkWeak tests"
This reverts commit 2db3199510
.
This commit is contained in:
parent
e691034861
commit
81025cd468
@ -188,33 +188,15 @@ class Parsedown
|
||||
|
||||
# ~
|
||||
|
||||
$highPriority = array();
|
||||
|
||||
$blockTypes = $this->unmarkedBlockTypes;
|
||||
|
||||
if (isset($this->BlockTypes[$marker]))
|
||||
{
|
||||
foreach ($this->BlockTypes[$marker] as $blockType)
|
||||
{
|
||||
if
|
||||
(
|
||||
isset($CurrentBlock['type'])
|
||||
and $CurrentBlock['type'] === $blockType
|
||||
and ! isset($CurrentBlock['interrupted'])
|
||||
and isset($CurrentBlock['continuable'])
|
||||
and ! isset($CurrentBlock['complete'])
|
||||
)
|
||||
{
|
||||
$highPriority[] = $CurrentBlock['type'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$blockTypes []= $blockType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$blockTypes = array_merge($highPriority, $blockTypes);
|
||||
|
||||
#
|
||||
# ~
|
||||
@ -607,6 +589,8 @@ class Parsedown
|
||||
return null;
|
||||
}
|
||||
|
||||
unset($placeholder);
|
||||
|
||||
if ($Line['text'][0] === '[' and $this->blockReference($Line))
|
||||
{
|
||||
return $Block;
|
||||
@ -614,7 +598,7 @@ class Parsedown
|
||||
|
||||
if ( ! isset($Block['interrupted']))
|
||||
{
|
||||
$text = preg_replace('/^[ ]{0,'.min(4, $Block['indent']).'}/', '', $Line['body']);
|
||||
$text = preg_replace('/^[ ]{0,'.min(4, $Block['indent'] + 1).'}/', '', $Line['body']);
|
||||
|
||||
$Block['li']['text'] []= $text;
|
||||
|
||||
@ -625,12 +609,7 @@ class Parsedown
|
||||
{
|
||||
$Block['li']['text'] []= '';
|
||||
|
||||
$text = preg_replace('/^[ ]{0,4}/', '', $Line['body']);
|
||||
|
||||
if ($placeholder = $this->blockList($Line))
|
||||
{
|
||||
$text = preg_replace('/^[ ]{0,'.min(4, $Block['indent']).'}/', '', $Line['body']);
|
||||
}
|
||||
$text = preg_replace('/^[ ]{0,'.min(4, $Block['indent'] + 1).'}/', '', $Line['body']);
|
||||
|
||||
$Block['li']['text'] []= $text;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user