diff options
author | Michael <icarus@dabo.de> | 2012-02-19 20:09:42 +0100 |
---|---|---|
committer | Michael <icarus@dabo.de> | 2012-02-19 20:09:42 +0100 |
commit | cafd4003522a472d2709569ea5eb5f80b817af23 (patch) | |
tree | bbd512126515afc929de06dce79ba847b9681092 /include/bb2diaspora.php | |
parent | 73e0e4d78341cb96ef9665a0ee4fb7e7ee2a701f (diff) | |
parent | a9ed5915cebcf51347acaad51d0c252e57bceaff (diff) | |
download | volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.tar.gz volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.tar.bz2 volse-hubzilla-cafd4003522a472d2709569ea5eb5f80b817af23.zip |
Merge remote branch 'upstream/master'
Conflicts:
view/theme/vier/style.css
Diffstat (limited to 'include/bb2diaspora.php')
-rwxr-xr-x | include/bb2diaspora.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php index d367b6716..c26b0c334 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('#','#',$s); + $s = str_replace("\n",'<br />',$s); + $s = html2bbcode($s); // $s = str_replace('*','*',$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; } @@ -209,7 +212,7 @@ function bb2diaspora($Text,$preserve_nl = false) { $Text = preg_replace("/\[vimeo\]([0-9]+)(.*?)\[\/vimeo\]/ism", 'http://vimeo.com/$1',$Text); - + $Text = str_replace('[nosmile]','',$Text); // oembed tag // $Text = oembed_bbcode2html($Text); |