aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-12-22 20:54:22 -0800
committerfriendica <info@friendica.com>2014-12-22 20:54:22 -0800
commit8db34ac8264d066b644ab579401f00ed3cc4cc62 (patch)
treeb84938d3740b8ba6ebef39bc526656e01db7109a /include/bb2diaspora.php
parentee89ff51244f6c5cd9a1d3b563c932dacbde89d9 (diff)
downloadvolse-hubzilla-8db34ac8264d066b644ab579401f00ed3cc4cc62.tar.gz
volse-hubzilla-8db34ac8264d066b644ab579401f00ed3cc4cc62.tar.bz2
volse-hubzilla-8db34ac8264d066b644ab579401f00ed3cc4cc62.zip
diaspora formatting improvements (getting too many xx-large posts)
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php10
1 files 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("&#xD;","\r",$s);
$s = str_replace("&#xD;\n&gt;","",$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);
// <br/> is invalid. Replace it with the valid expression
- $s = str_replace("<br/>","<br />",$s);
- $s = str_replace("\n","<br />",$s);
+// $s = str_replace("<br/>","<br />",$s);
+// $s = str_replace("\n","<br />",$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('&#35;','#',$s);
// we seem to have double linebreaks
// $s = str_replace("\n",'<br />',$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);