Ensure line-breaks get standardised when using via `line` method

As noted in https://github.com/erusev/parsedown/pull/624 there are
occasions where line break standardisation is assumed (e.g. where
`inlineCode` replaces line breaks with a space).

Closes #624
This commit is contained in:
Aidan Woods 2018-10-16 18:41:42 +01:00
parent c26a2ee4bf
commit 89c3fa05d9
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
1 changed files with 3 additions and 0 deletions

View File

@ -1119,6 +1119,9 @@ class Parsedown
protected function lineElements($text, $nonNestables = array())
{
# standardize line breaks
$text = str_replace(array("\r\n", "\r"), "\n", $text);
$Elements = array();
$nonNestables = (empty($nonNestables)