1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Don't special case invisible

If something has no html, it doesn't need to have a newline
This commit is contained in:
Aidan Woods 2019-01-26 20:38:06 +00:00
parent d6f526d80f
commit bc3c1544c5
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

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