aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-02-01 17:09:53 -0800
committerfriendica <info@friendica.com>2012-02-01 17:09:53 -0800
commit9fc36d3da4e85b4b25b7abe1917cb2188eea77ea (patch)
tree01d388a4e605a5d04790e4f9a8cb63d8fa6766ac
parentc68235d10da7edf030390c21f03af240ffa49252 (diff)
downloadvolse-hubzilla-9fc36d3da4e85b4b25b7abe1917cb2188eea77ea.tar.gz
volse-hubzilla-9fc36d3da4e85b4b25b7abe1917cb2188eea77ea.tar.bz2
volse-hubzilla-9fc36d3da4e85b4b25b7abe1917cb2188eea77ea.zip
improvements in d* markdown conversion
-rwxr-xr-xboot.php2
-rwxr-xr-xinclude/bb2diaspora.php13
2 files changed, 9 insertions, 6 deletions
diff --git a/boot.php b/boot.php
index 696c9add2..9b192853c 100755
--- a/boot.php
+++ b/boot.php
@@ -9,7 +9,7 @@ require_once('include/nav.php');
require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica');
-define ( 'FRIENDICA_VERSION', '2.3.1241' );
+define ( 'FRIENDICA_VERSION', '2.3.1242' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1119 );
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;
}