From: Hypolite Petovan <ben.lort@gmail.com>
Date: Sun, 12 Mar 2017 07:55:22 +0000 (-0400)
Subject: Normalize line endings instead of adding <br> before Markdown()
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2310bf994a10996d2b6986e70d56765974581480;p=friendica.git

Normalize line endings instead of adding <br> before Markdown()
---

diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index f18a0f3c27..e509999236 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -39,9 +39,9 @@ function diaspora2bb($s) {
 	$s = html_entity_decode($s, ENT_COMPAT, 'UTF-8');
 
 	// Handles single newlines
-	$s = str_replace("\r", '<br>', $s);
-
+	$s = str_replace("\r\n", "\n", $s);
 	$s = str_replace("\n", " \n", $s);
+	$s = str_replace("\r", " \n", $s);
 
 	// Replace lonely stars in lines not starting with it with literal stars
 	$s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);