From 8db34ac8264d066b644ab579401f00ed3cc4cc62 Mon Sep 17 00:00:00 2001 From: friendica Date: Mon, 22 Dec 2014 20:54:22 -0800 Subject: diaspora formatting improvements (getting too many xx-large posts) --- include/bb2diaspora.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index 3c4f07568..49dee8759 100644 --- a/include/bb2diaspora.php +++ b/include/bb2diaspora.php @@ -116,6 +116,7 @@ function diaspora_mention_callback($matches) { function diaspora2bb($s,$use_zrl = false) { + $s = str_replace(" ","\r",$s); $s = str_replace(" \n>","",$s); $s = html_entity_decode($s,ENT_COMPAT,'UTF-8'); @@ -123,11 +124,11 @@ function diaspora2bb($s,$use_zrl = false) { // Too many new lines. So deactivated the following line // $s = str_replace("\r","\n",$s); // Simply remove cr. - $s = str_replace("\r","",$s); +// $s = str_replace("\r","",$s); //
is invalid. Replace it with the valid expression - $s = str_replace("
","
",$s); - $s = str_replace("\n","
",$s); +// $s = str_replace("
","
",$s); +// $s = str_replace("\n","
",$s); // $s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s); @@ -147,6 +148,8 @@ function diaspora2bb($s,$use_zrl = false) { $s = Markdown($s); + $s = str_replace("\r","",$s); + $s = str_replace('#','#',$s); // we seem to have double linebreaks // $s = str_replace("\n",'
',$s); @@ -175,7 +178,6 @@ function diaspora2bb($s,$use_zrl = false) { // remove duplicate adjacent code tags $s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s); - $s = preg_replace_callback('/\[share(.*?)\]/ism','share_unshield',$s); -- cgit v1.2.3