aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 8f2b5bd38..82d0bd1d1 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -582,9 +582,14 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
if (strpos($Text,'[h6]') !== false) {
$Text = preg_replace("(\[h6\](.*?)\[\/h6\])ism",'<h6>$1</h6>',$Text);
}
- // Check for table of content
+ // Check for table of content without params
if (strpos($Text,'[toc]') !== false) {
- $Text = preg_replace("/\[toc\]/ism",'<ul id="toc"></ul>',$Text);
+ $Text = preg_replace("/\[toc\]/ism",'<ul id="toc"></ul>',$Text);
+ }
+ // Check for table of content with params
+ if (strpos($Text,'[toc') !== false) {
+ $Text = preg_replace("/\[toc([^\]]+?)\]/ism",'<ul$1></ul>',$Text);
+
}
// Check for centered text
if (strpos($Text,'[/center]') !== false) {