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

Trim in renderer

This commit is contained in:
Aidan Woods 2019-02-16 21:10:45 +00:00
parent 3ccd64a9a1
commit 4a215f33d4
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -47,9 +47,6 @@ final class Parsedown
$html = self::render($Renderables); $html = self::render($Renderables);
# trim line breaks
$html = \trim($html, "\n");
return $html; return $html;
} }
@ -245,7 +242,8 @@ final class Parsedown
*/ */
public static function render(array $Renderables) public static function render(array $Renderables)
{ {
return \array_reduce( return \trim(
\array_reduce(
$Renderables, $Renderables,
/** /**
* @param string $html * @param string $html
@ -257,6 +255,8 @@ final class Parsedown
return $html . ($newHtml === '' ? '' : "\n") . $newHtml; return $html . ($newHtml === '' ? '' : "\n") . $newHtml;
}, },
'' ''
),
"\n"
); );
} }
} }