1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

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

View File

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