aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index d69cb263f..9fce895b8 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -189,8 +189,18 @@ function bbcode($Text,$preserve_nl = false) {
// Check for [code] text
$Text = preg_replace("/\[code\](.*?)\[\/code\]/ism","$CodeLayout", $Text);
+ // Declare the format for [spoiler] layout
+ $SpoilerLayout = '<blockquote class="spoiler">$1</blockquote>';
+
+ // Check for [spoiler] text
+ // handle nested quotes
+ $endlessloop = 0;
+ while ((strpos($Text, "[/spoiler]") !== false) and (strpos($Text, "[spoiler]") !== false) and (++$endlessloop < 20))
+ $Text = preg_replace("/\[spoiler\](.*?)\[\/spoiler\]/ism","$SpoilerLayout", $Text);
+
// Declare the format for [quote] layout
$QuoteLayout = '<blockquote>$1</blockquote>';
+
// Check for [quote] text
// handle nested quotes
$endlessloop = 0;