diff --git a/src/Parsedown.php b/src/Parsedown.php index 3890188..679376a 100644 --- a/src/Parsedown.php +++ b/src/Parsedown.php @@ -12,7 +12,6 @@ use Erusev\Parsedown\Components\StateUpdatingBlock; use Erusev\Parsedown\Configurables\BlockTypes; use Erusev\Parsedown\Configurables\InlineTypes; use Erusev\Parsedown\Html\Renderable; -use Erusev\Parsedown\Html\Renderables\Invisible; use Erusev\Parsedown\Html\Renderables\Text; use Erusev\Parsedown\Parsing\Context; use Erusev\Parsedown\Parsing\Excerpt; @@ -244,11 +243,9 @@ final class Parsedown * @return string */ function ($html, Renderable $Renderable) { - return ( - $html - . ($Renderable instanceof Invisible ? '' : "\n") - . $Renderable->getHtml() - ); + $newHtml = $Renderable->getHtml(); + + return $html . ($newHtml === '' ? '' : "\n") . $newHtml; }, '' );