Merge pull request #627 from aidantwoods/fix/hidden-blocks

Intepret special "hidden" key as an empty element
This commit is contained in:
Aidan Woods 2018-05-08 22:07:51 +01:00 committed by GitHub
commit c9e7183cfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

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