aboutsummaryrefslogtreecommitdiffstats
path: root/include/bb2diaspora.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/bb2diaspora.php')
-rw-r--r--include/bb2diaspora.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/bb2diaspora.php b/include/bb2diaspora.php
index 9ede42f6c..b0e12027a 100644
--- a/include/bb2diaspora.php
+++ b/include/bb2diaspora.php
@@ -196,6 +196,14 @@ function bb2diaspora($Text,$preserve_nl = false, $fordiaspora = true) {
// The bbcode parser now handles youtube-links (and the other stuff) correctly.
// Additionally the html code is now fixed so that lists are now working.
+ /**
+ * Transform #tags, strip off the [url] and replace spaces with underscore
+ */
+ $Text = preg_replace_callback('/#\[url\=(\w+.*?)\](\w+.*?)\[\/url\]/i', create_function('$match',
+ 'return \'#\'. str_replace(\' \', \'_\', $match[2]);'
+ ), $Text);
+
+
// Converting images with size parameters to simple images. Markdown doesn't know it.
$Text = preg_replace("/\[img\=([0-9]*)x([0-9]*)\](.*?)\[\/img\]/ism", '[img]$3[/img]', $Text);