From 4a6bb88239b3542d23a9b5895715edeb02bd9db3 Mon Sep 17 00:00:00 2001 From: Emanuil <4thmail@gmail.com> Date: Sat, 31 Aug 2013 19:54:14 +0300 Subject: [PATCH] improve the code that removes \r characters --- Parsedown.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Parsedown.php b/Parsedown.php index 5059bb7..79f900b 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -50,7 +50,8 @@ class Parsedown $text = preg_replace('{^\xEF\xBB\xBF|\x1A}', '', $text); # Removes \r characters. - $text = str_replace("\r", '', $text); + $text = str_replace("\r\n", "\n", $text); + $text = str_replace("\r", "\n", $text); # Replaces tabs with spaces. $text = str_replace("\t", ' ', $text);