Open lukasleitsch opened 4 years ago
Some PHP environments trims the new line characters of the loaded HTML in a DOMDocument. But the new line characters are needed to split the lines.
Fix #153
PHP-Version: 7.4.9 Parsedown: 1.8.0-beta-7 ParsedownExtra: 0.8.0
<div markdown="1"> ## Headline <ul> <li>Foo</li> <li>Bar</li> </ul> <ul> <li>Second Foo</li> <li>Second Bar</li> </ul> </div>
<div> <h2>Headline</h2> <ul> <li>Foo</li> <li>Bar</li> </ul> <ul> <li>Second Foo</li> <li>Second Bar</li> </ul> </div>
<div> <h2>Headline</h2> <ul><li>Foo</li> <li>Bar</li> </ul> </div>
The second list is missing on the production server. The cause is DOMDocument trims the new line characters in some PHP environments.
This PR adds the formatOutput property to the DOMDocument Object to solve the issue.
formatOutput
Some PHP environments trims the new line characters of the loaded HTML in a DOMDocument. But the new line characters are needed to split the lines.
Fix #153
PHP-Version: 7.4.9 Parsedown: 1.8.0-beta-7 ParsedownExtra: 0.8.0
Input
Local machine output
Production server output
The second list is missing on the production server. The cause is DOMDocument trims the new line characters in some PHP environments.
This PR adds the
formatOutput
property to the DOMDocument Object to solve the issue.