1
0
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:
Aidan Woods 2018-04-08 20:27:44 +01:00
parent 50f15add44
commit 39df7d4f8e
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -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'])
); );