aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-23 01:33:58 -0700
committerFriendika <info@friendika.com>2011-08-23 01:33:58 -0700
commitc1a1b2ab60b9c19d49580869a0835b0be6f0eb0d (patch)
treeb1a1d05c62454dc9742a16e8e198f6fbae8abfdf
parent561051e805e3f262ed5e8e5f712e2e514ecb90b8 (diff)
downloadvolse-hubzilla-c1a1b2ab60b9c19d49580869a0835b0be6f0eb0d.tar.gz
volse-hubzilla-c1a1b2ab60b9c19d49580869a0835b0be6f0eb0d.tar.bz2
volse-hubzilla-c1a1b2ab60b9c19d49580869a0835b0be6f0eb0d.zip
updates bb2md
-rw-r--r--include/bb2diaspora.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index a4e7997fa..007a2bf35 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -32,6 +32,8 @@ function bb2diaspora($Text,$preserve_nl = false) {
// Perform URL Search
+ // [img]pathtoimage[/img]
+ $Text = preg_replace("/\[img\](.*?)\[\/img\]/", t('Image/photo: ') . '$1', $Text);
$Text = preg_replace("/\[url\]([$URLSearchString]*)\[\/url\]/", '[$1]($1)', $Text);
@@ -43,6 +45,11 @@ function bb2diaspora($Text,$preserve_nl = false) {
$Text = preg_replace("(\[mail\]([$MAILSearchString]*)\[/mail\])", '[$1](mailto:$1)', $Text);
$Text = preg_replace("/\[mail\=([$MAILSearchString]*)\](.*?)\[\/mail\]/", '[$2](mailto:$1)', $Text);
+ $Text = str_replace('*', '\\*', $Text);
+ $Text = str_replace('_', '\\_', $Text);
+
+ $Text = str_replace('`','\\`', $Text);
+
// Check for bold text
$Text = preg_replace("(\[b\](.*?)\[\/b\])is",'**$1**',$Text);
@@ -92,7 +99,7 @@ function bb2diaspora($Text,$preserve_nl = false) {
// $CodeLayout = '<code>$1</code>';
// Check for [code] text
-// $Text = preg_replace("/\[code\](.*?)\[\/code\]/is","$CodeLayout", $Text);
+ $Text = preg_replace("/\[code\](.*?)\[\/code\]/is","```$1```", $Text);
@@ -103,8 +110,6 @@ function bb2diaspora($Text,$preserve_nl = false) {
// $Text = preg_replace("/\[quote\](.*?)\[\/quote\]/is","$QuoteLayout", $Text);
// Images
- // [img]pathtoimage[/img]
-// $Text = preg_replace("/\[img\](.*?)\[\/img\]/", '<img src="$1" alt="' . t('Image/photo') . '" />', $Text);
// html5 video and audio