mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Add compat for extensions using old markup
key.
This commit is contained in:
parent
b75fd409ff
commit
2bf7ca41a0
@ -264,7 +264,7 @@ class Parsedown
|
||||
{
|
||||
if (isset($CurrentBlock))
|
||||
{
|
||||
$Elements[] = $CurrentBlock['element'];
|
||||
$Elements[] = $this->extractElement($CurrentBlock);
|
||||
}
|
||||
|
||||
$Block['identified'] = true;
|
||||
@ -296,7 +296,7 @@ class Parsedown
|
||||
{
|
||||
if (isset($CurrentBlock))
|
||||
{
|
||||
$Elements[] = $CurrentBlock['element'];
|
||||
$Elements[] = $this->extractElement($CurrentBlock);
|
||||
}
|
||||
|
||||
$CurrentBlock = $this->paragraph($Line);
|
||||
@ -316,7 +316,7 @@ class Parsedown
|
||||
|
||||
if (isset($CurrentBlock))
|
||||
{
|
||||
$Elements[] = $CurrentBlock['element'];
|
||||
$Elements[] = $this->extractElement($CurrentBlock);
|
||||
}
|
||||
|
||||
# ~
|
||||
@ -324,6 +324,16 @@ class Parsedown
|
||||
return $Elements;
|
||||
}
|
||||
|
||||
protected function extractElement(array $Component)
|
||||
{
|
||||
if ( ! isset($Component['element']) and isset($Component['markup']))
|
||||
{
|
||||
$Component['element'] = array('rawHtml' => $Component['markup']);
|
||||
}
|
||||
|
||||
return $Component['element'];
|
||||
}
|
||||
|
||||
protected function isBlockContinuable($Type)
|
||||
{
|
||||
return method_exists($this, 'block'.$Type.'Continue');
|
||||
@ -1169,7 +1179,7 @@ class Parsedown
|
||||
$Elements[] = $InlineText['element'];
|
||||
|
||||
# compile the inline
|
||||
$Elements[] = $Inline['element'];
|
||||
$Elements[] = $this->extractElement($Inline);
|
||||
|
||||
# remove the examined text
|
||||
$text = substr($text, $Inline['position'] + $Inline['extent']);
|
||||
|
Loading…
Reference in New Issue
Block a user