diff --git a/app/Services/Markdown/Formatter.php b/app/Services/Markdown/Formatter.php index 637edcf..d3fa94f 100644 --- a/app/Services/Markdown/Formatter.php +++ b/app/Services/Markdown/Formatter.php @@ -155,6 +155,13 @@ protected function removeEmptyCodeLines(string $html): string } } - return $dom->saveHTML(); + $finalHtml = ''; + $bodyTag = $dom->documentElement->getElementsByTagName('body')->item(0); + + foreach ($bodyTag->childNodes as $rootLevelTag) { + $finalHtml .= $dom->saveHTML($rootLevelTag); + } + + return $finalHtml; } }