]> git.mxchange.org Git - friendica.git/commitdiff
Fixs edge case where single stars on succeeding lines are wrongly turned into multi...
authorHypolite Petovan <ben.lort@gmail.com>
Tue, 6 Dec 2016 03:47:52 +0000 (22:47 -0500)
committerHypolite Petovan <ben.lort@gmail.com>
Tue, 6 Dec 2016 03:47:52 +0000 (22:47 -0500)
include/bb2diaspora.php

index d6bff9ab5b993a608a004474e11cb754effb4c67..933055b1b3bcf990c4d17ce292a00812c3ffdd8d 100644 (file)
@@ -22,6 +22,9 @@ function diaspora2bb($s) {
 
        $s = str_replace("\n", " \n", $s);
 
+       // Replace lonely stars in lines not starting with it with literal stars
+       $s = preg_replace('/^([^\*]+)\*([^\*]*)$/im', '$1\*$2', $s);
+
        // The parser cannot handle paragraphs correctly
        $s = str_replace(array('</p>', '<p>', '<p dir="ltr">'), array('<br>', '<br>', '<br>'), $s);