aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorMichael Vogel <icarus@dabo.de>2012-03-17 11:07:49 +0100
committerMichael Vogel <icarus@dabo.de>2012-03-17 11:07:49 +0100
commit8a1f175df022e2fc2c2162aa314ea34454482d48 (patch)
tree08daca362b42d402322787f4e69810c2999ff791 /include/bbcode.php
parentb5120888cf6e3aac29aa2a8d80bddcab73822e1e (diff)
downloadvolse-hubzilla-8a1f175df022e2fc2c2162aa314ea34454482d48.tar.gz
volse-hubzilla-8a1f175df022e2fc2c2162aa314ea34454482d48.tar.bz2
volse-hubzilla-8a1f175df022e2fc2c2162aa314ea34454482d48.zip
New bbcode element: "spoiler". Mail: Top post quotes are now embraced in "spoiler" elements
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;