aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/bb2diaspora.php4
-rw-r--r--mod/item.php9
-rw-r--r--version.inc2
3 files changed, 10 insertions, 5 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index f9ecc564f..2ac1f43c8 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -74,9 +74,6 @@ function bb_tag_preg_replace($pattern, $replace, $name, $s) {
function diaspora2bb($s) {
- // for testing purposes: Collect raw markdown articles
- // $file = tempnam("/tmp/friendica/", "markdown");
- // file_put_contents($file, $s);
$s = html_entity_decode($s,ENT_COMPAT,'UTF-8');
@@ -87,6 +84,7 @@ function diaspora2bb($s) {
// <br/> is invalid. Replace it with the valid expression
$s = str_replace("<br/>","<br />",$s);
+ $s = str_replace("\n","<br />",$s);
$s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
diff --git a/mod/item.php b/mod/item.php
index c9ec56eeb..ce43bdf96 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -375,7 +375,7 @@ function item_post(&$a) {
killme();
}
}
-
+
$expires = '0000-00-00 00:00:00';
@@ -422,6 +422,13 @@ function item_post(&$a) {
if($mimetype === 'text/bbcode') {
+ if(local_user() && local_user() == $profile_uid && get_pconfig(local_user(),'editor','use_markdown')) {
+ require_once('include/bb2diaspora.php');
+ $body = diaspora2bb($body);
+ }
+
+
+
// BBCODE alert: the following functions assume bbcode input
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
// we may need virtual or template classes to implement the possible alternatives
diff --git a/version.inc b/version.inc
index b92fd894a..e70c648ee 100644
--- a/version.inc
+++ b/version.inc
@@ -1 +1 @@
-2014-06-30.722
+2014-07-01.723