$s = html2bbcode($s);
// $s = str_replace('*','*',$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);
// remove duplicate adjacent code tags
$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;
}
$Text = preg_replace("/\[img\](.*?)\[\/img\]/", '![' . t('image/photo') . '](' . '$1' . ')', $Text);
+ $Text = preg_replace("/\[img\=(.*?)\](.*?)\[\/img\]/", '![' . t('image/photo') . '](' . '$2' . ')', $Text);
// Perform MAIL Search
$Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '[$1](mailto:$1)', $Text);
$bd_format = t('l F d, Y \@ g:i A') ; // Friday January 18, 2011 @ 8 AM
- $o = 'Friendika event notification:' . "\n";
+ $o = 'Friendica event notification:' . "\n";
$o .= '**' . bb2diaspora($ev['desc']) . '**' . "\n";