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:
parent
d6f526d80f
commit
bc3c1544c5
@ -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;
|
||||
},
|
||||
''
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user