aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-01 19:23:45 -0800
committerfriendica <info@friendica.com>2012-02-01 19:23:45 -0800
commit94e396e6c4fda7a9113bfdb122fadfde0421e81c (patch)
tree2eb48e4a901751d0fc7e8bdf3f26564f34db6a3d /include/bb2diaspora.php
parent64d0616762efcff413a335f2fdde4d8219d44895 (diff)
parent840f69e2c8ba014b89314191859ad0b8b35631d5 (diff)
downloadvolse-hubzilla-94e396e6c4fda7a9113bfdb122fadfde0421e81c.tar.gz
volse-hubzilla-94e396e6c4fda7a9113bfdb122fadfde0421e81c.tar.bz2
volse-hubzilla-94e396e6c4fda7a9113bfdb122fadfde0421e81c.zip
Merge branch 'master' into spam
Diffstat (limited to 'include/bb2diaspora.php')
-rwxr-xr-xinclude/bb2diaspora.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index d367b6716..9a29b05a2 100755
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -14,9 +14,17 @@ require_once('include/html2bbcode.php');
function diaspora2bb($s) {
$s = html_entity_decode($s,ENT_COMPAT,'UTF-8');
+ $s = str_replace("\r","\n",$s);
$s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
+
+ $s = preg_replace('/\#([^\s\#])/','\\#$1',$s);
+
$s = Markdown($s);
+
+ $s = str_replace('&#35;','#',$s);
+ $s = str_replace("\n",'<br />',$s);
+
$s = html2bbcode($s);
// $s = str_replace('&#42;','*',$s);
@@ -30,11 +38,6 @@ function diaspora2bb($s) {
$s = preg_replace("/(\[code\])+(.*?)(\[\/code\])+/ism","[code]$2[/code]", $s);
$s = scale_diaspora_images($s);
- // we seem to get a lot of text smushed together with links from Diaspora.
-
- $s = preg_replace('/[^ ]\[url\=(.*?)\]/',' [url=$1]' ,$s);
- $s = preg_replace('/\[\/url\][^ ]/','[/url] ',$s);
-
return $s;
}