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

rtrim non hard breaking lines

This commit is contained in:
Aidan Woods 2019-01-22 20:50:11 +00:00
parent fc37ad11ed
commit 74bba0b2fa
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -55,6 +55,8 @@ final class PlainText implements Inline
$Renderables = [];
$text = $this->text;
$text = \preg_replace('/(?<![ \t])[ ]\n/', "$1\n", $text);
while (\preg_match('/(?:[ ]*+\\\\|[ ]{2,}+)\n/', $text, $matches, \PREG_OFFSET_CAPTURE)) {
$offset = \intval($matches[0][1]);
$before = \substr($text, 0, $offset);