aboutsummaryrefslogtreecommitdiffstats
path: root/include/markdown.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/markdown.php')
-rw-r--r--include/markdown.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/markdown.php b/include/markdown.php
index 7d1f16958..69cc264df 100644
--- a/include/markdown.php
+++ b/include/markdown.php
@@ -246,6 +246,9 @@ function bb_to_markdown($Text, $options = []) {
call_hooks('bb_to_markdown_bb', $x);
$Text = $x['bbcode'];
+
+ // Replace spoiler tag before BBcode conversion
+ $Text = preg_replace("/\[\/?spoiler\]/is", "\n--- " .t('spoiler') . " ---\n", $Text);
// Convert it to HTML - don't try oembed
$Text = bbcode($Text, [ 'tryoembed' => false ]);
@@ -264,6 +267,9 @@ function bb_to_markdown($Text, $options = []) {
// Remove empty zrl links
$Text = preg_replace("/\[zrl\=\].*?\[\/zrl\]/is", "", $Text);
+
+ // Replace unprocessed <br> in code
+ $Text = str_replace("<br></br>", "\n", $Text);
$Text = trim($Text);