From 83cf2d4ab402a5704d45d03dadf1479faf8d4f0e Mon Sep 17 00:00:00 2001 From: Lukas Leitsch Date: Mon, 10 Aug 2020 19:55:30 +0200 Subject: [PATCH] fix parsedown extra parsing issue Parsedown Extra trims new line characters in some PHP environments. Parsedown Extra Issue: https://github.com/erusev/parsedown-extra/issues/153 Parsedown Extra PR: https://github.com/erusev/parsedown-extra/pull/155 --- dependencies/parsedown-extra/ParsedownExtra.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dependencies/parsedown-extra/ParsedownExtra.php b/dependencies/parsedown-extra/ParsedownExtra.php index 9e1a748ab6..c3db03adf0 100644 --- a/dependencies/parsedown-extra/ParsedownExtra.php +++ b/dependencies/parsedown-extra/ParsedownExtra.php @@ -572,6 +572,9 @@ protected function processTag($elementMarkup) # recursive # http://stackoverflow.com/q/11309194/200145 $elementMarkup = mb_convert_encoding($elementMarkup, 'HTML-ENTITIES', 'UTF-8'); + + # Ensure that saveHTML() is not remove new line characters. New lines will be split by this character. + $DOMDocument->formatOutput = true; # http://stackoverflow.com/q/4879946/200145 $DOMDocument->loadHTML($elementMarkup);