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 1, 2020
1 parent ed95cd6 commit 6d5dbdb
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 6d5dbdb

Please sign in to comment.