mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
9 Commits
1.8.0-beta
...
1.8.0-beta
Author | SHA1 | Date | |
---|---|---|---|
c26a2ee4bf | |||
ba3b60d6e4 | |||
0b1e6b8c86 | |||
1f69f7e697 | |||
c83af0a7d5 | |||
4686daf8c2 | |||
c9e7183cfa | |||
9eed1104e7 | |||
fd95703da5 |
@ -17,7 +17,7 @@ class Parsedown
|
||||
{
|
||||
# ~
|
||||
|
||||
const version = '1.8.0-beta-1';
|
||||
const version = '1.8.0-beta-5';
|
||||
|
||||
# ~
|
||||
|
||||
@ -317,9 +317,16 @@ class Parsedown
|
||||
|
||||
protected function extractElement(array $Component)
|
||||
{
|
||||
if ( ! isset($Component['element']) and isset($Component['markup']))
|
||||
if ( ! isset($Component['element']))
|
||||
{
|
||||
$Component['element'] = array('rawHtml' => $Component['markup']);
|
||||
if (isset($Component['markup']))
|
||||
{
|
||||
$Component['element'] = array('rawHtml' => $Component['markup']);
|
||||
}
|
||||
elseif (isset($Component['hidden']))
|
||||
{
|
||||
$Component['element'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
return $Component['element'];
|
||||
@ -384,6 +391,11 @@ class Parsedown
|
||||
}
|
||||
}
|
||||
|
||||
protected function blockCodeComplete($Block)
|
||||
{
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Comment
|
||||
|
||||
@ -501,6 +513,11 @@ class Parsedown
|
||||
return $Block;
|
||||
}
|
||||
|
||||
protected function blockFencedCodeComplete($Block)
|
||||
{
|
||||
return $Block;
|
||||
}
|
||||
|
||||
#
|
||||
# Header
|
||||
|
||||
@ -1208,14 +1225,14 @@ class Parsedown
|
||||
'element' => array(),
|
||||
);
|
||||
|
||||
$safeText = self::escape($text, true);
|
||||
|
||||
$Inline['element']['rawHtml'] = preg_replace(
|
||||
$Inline['element']['elements'] = self::pregReplaceElements(
|
||||
$this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[ ]*+\\\\|[ ]{2,}+)\n/',
|
||||
"<br />\n",
|
||||
$safeText
|
||||
array(
|
||||
array('name' => 'br'),
|
||||
array('text' => "\n"),
|
||||
),
|
||||
$text
|
||||
);
|
||||
$Inline['element']['allowRawHtmlInSafeMode'] = true;
|
||||
|
||||
return $Inline;
|
||||
}
|
||||
|
Reference in New Issue
Block a user