From: Hypolite Petovan
Date: Tue, 6 Dec 2016 03:47:52 +0000 (-0500)
Subject: Fixs edge case where single stars on succeeding lines are wrongly turned into multi...
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=d0cb8cdccfc0260ec00468079769e3615df06774;p=friendica.git
Fixs edge case where single stars on succeeding lines are wrongly turned into multi-line
---
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index d6bff9ab5b..933055b1b3 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -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('
', '', '
'), array('
', '
', '
'), $s);