aboutsummaryrefslogtreecommitdiffstats
path: root/include/markdown.php
diff options
context:
space:
mode:
authorHilmar R <u02@u29lx193>2021-02-28 21:06:16 +0100
committerHilmar R <u02@u29lx193>2021-03-01 18:48:11 +0100
commitc26dede97f626b52b7bf8962ed55d1dbda86abe8 (patch)
tree3c8c9bc97aa09f7ce9afe9bf467cf87bbf2c7d0b /include/markdown.php
parentea3390d626f85b7293a750958bfd1b5460958365 (diff)
downloadvolse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.gz
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.tar.bz2
volse-hubzilla-c26dede97f626b52b7bf8962ed55d1dbda86abe8.zip
get dev
Diffstat (limited to 'include/markdown.php')
-rw-r--r--include/markdown.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/markdown.php b/include/markdown.php
index 0bfe595b8..013d57c29 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -213,6 +213,11 @@ function bb_to_markdown_share($match) {
}
+function bb_to_markdown_transform_tags($match) {
+ return '#'. str_replace(' ', '_', $match[3]);
+}
+
+
/**
* @brief Convert bbcode to Markdown.
*
@@ -226,8 +231,7 @@ function bb_to_markdown($Text, $options = []) {
* Transform #tags, strip off the [url] and replace spaces with underscore
*/
- $Text = preg_replace_callback('/#\[([zu])rl\=(.*?)\](.*?)\[\/[(zu)]rl\]/i',
- create_function('$match', 'return \'#\'. str_replace(\' \', \'_\', $match[3]);'), $Text);
+ $Text = preg_replace_callback('/#\[([zu])rl\=(.*?)\](.*?)\[\/[(zu)]rl\]/i', 'bb_to_markdown_transform_tags', $Text);
$Text = preg_replace('/#\^\[([zu])rl\=(.*?)\](.*?)\[\/([zu])rl\]/i', '[$1rl=$2]$3[/$4rl]', $Text);
@@ -282,7 +286,6 @@ function bb_to_markdown($Text, $options = []) {
return $Text;
}
-
/**
* @brief Convert a HTML text into Markdown.
*