]> git.mxchange.org Git - friendica.git/commitdiff
fix D* links+text smushed together
authorfriendica <info@friendica.com>
Wed, 11 Jan 2012 22:03:27 +0000 (14:03 -0800)
committerfriendica <info@friendica.com>
Wed, 11 Jan 2012 22:03:27 +0000 (14:03 -0800)
include/bb2diaspora.php

index e819976a7a85ffc10a529ec6c5a347435307ff85..8564d20e3580303d33c7e0cc9290930d27f06885 100644 (file)
@@ -19,6 +19,11 @@ function diaspora2bb($s) {
        $s = Markdown($s);
        $s = html2bbcode($s);
 //     $s = str_replace('&#42;','*',$s);
+
+       // we seem to get a lot of text smushed together with links from Diaspora.
+       // if it's a url that we haven't already parsed into a bbcode structure, put a space before it.
+       $s = preg_replace("/([^=])(https?:\/\/)/ism",'$1 $2',$s);
+
     $s = preg_replace("/\[url\=?(.*?)\]https?:\/\/www.youtube.com\/watch\?v\=(.*?)\[\/url\]/ism",'[youtube]$2[/youtube]',$s); 
     $s = preg_replace("/\[url\=https?:\/\/www.youtube.com\/watch\?v\=(.*?)\].*?\[\/url\]/ism",'[youtube]$1[/youtube]',$s); 
        $s = preg_replace("/\[url\=?(.*?)\]https?:\/\/vimeo.com\/([0-9]+)(.*?)\[\/url\]/ism",'[vimeo]$2[/vimeo]',$s);