From 39df7d4f8ea22f67c03ab1776f4b8f3efb4db365 Mon Sep 17 00:00:00 2001 From: Aidan Woods Date: Sun, 8 Apr 2018 20:27:44 +0100 Subject: [PATCH] Swap 'hidden' blocks for empty elements --- Parsedown.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 0a1bee5..f9f269e 100644 --- a/Parsedown.php +++ b/Parsedown.php @@ -878,18 +878,13 @@ class Parsedown $Data = array( '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; $Block = array( - 'hidden' => true, + 'element' => array(), ); return $Block; @@ -1776,6 +1771,11 @@ class Parsedown foreach ($Elements as $Element) { + if (empty($Element)) + { + continue; + } + $autoBreakNext = (isset($Element['autobreak']) && $Element['autobreak'] || ! isset($Element['autobreak']) && isset($Element['name']) );