]> git.mxchange.org Git - friendica.git/blobdiff - include/bb2diaspora.php
Merge pull request #3281 from annando/issue-3206-2957
[friendica.git] / include / bb2diaspora.php
index f18a0f3c276399cea0910a0e80df320577b85b03..03eff5a6b73a5bd2c398d11fe8c4d448110a1497 100644 (file)
@@ -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);
@@ -59,15 +59,6 @@ function diaspora2bb($s) {
 
        $s = str_replace('&#35;', '#', $s);
 
-       $search = array(" \n", "\n ");
-       $replace = array("\n", "\n");
-       do {
-               $oldtext = $s;
-               $s = str_replace($search, $replace, $s);
-       } while ($oldtext != $s);
-
-       $s = str_replace("\n\n", '<br>', $s);
-
        $s = html2bbcode($s);
 
        // protect the recycle symbol from turning into a tag, but without unescaping angles and naked ampersands