Skip to content

Commit

Permalink
fix parsedown extra parsing issue
Browse files Browse the repository at this point in the history
Parsedown Extra trims new line characters in some PHP environments.

Parsedown Extra Issue: erusev/parsedown-extra#153
Parsedown Extra PR: erusev/parsedown-extra#155
  • Loading branch information
lukasleitsch authored and bastianallgeier committed Sep 15, 2020
1 parent cc8a4a3 commit 588530c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dependencies/parsedown-extra/ParsedownExtra.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 588530c

Please sign in to comment.