mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Swap 'hidden' blocks for empty elements
This commit is contained in:
parent
50f15add44
commit
39df7d4f8e
@ -878,18 +878,13 @@ class Parsedown
|
|||||||
|
|
||||||
$Data = array(
|
$Data = array(
|
||||||
'url' => $matches[2],
|
'url' => $matches[2],
|
||||||
'title' => null,
|
'title' => isset($matches[3]) ? $matches[3] : null,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (isset($matches[3]))
|
|
||||||
{
|
|
||||||
$Data['title'] = $matches[3];
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->DefinitionData['Reference'][$id] = $Data;
|
$this->DefinitionData['Reference'][$id] = $Data;
|
||||||
|
|
||||||
$Block = array(
|
$Block = array(
|
||||||
'hidden' => true,
|
'element' => array(),
|
||||||
);
|
);
|
||||||
|
|
||||||
return $Block;
|
return $Block;
|
||||||
@ -1776,6 +1771,11 @@ class Parsedown
|
|||||||
|
|
||||||
foreach ($Elements as $Element)
|
foreach ($Elements as $Element)
|
||||||
{
|
{
|
||||||
|
if (empty($Element))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$autoBreakNext = (isset($Element['autobreak']) && $Element['autobreak']
|
$autoBreakNext = (isset($Element['autobreak']) && $Element['autobreak']
|
||||||
|| ! isset($Element['autobreak']) && isset($Element['name'])
|
|| ! isset($Element['autobreak']) && isset($Element['name'])
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user