aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2015-02-19 13:40:23 +1100
committerRedMatrix <info@friendica.com>2015-02-19 13:40:23 +1100
commit4a75d2d754166f536093002338f62105d4975b55 (patch)
tree9c5a6a64732b364551cbaa456648c5416f0968a5 /include
parentb7451b455728708427091e518b349cf61a5c6f78 (diff)
parent4e6ba149d70cc4d3ae915cb0d0f298c74e408527 (diff)
downloadvolse-hubzilla-4a75d2d754166f536093002338f62105d4975b55.tar.gz
volse-hubzilla-4a75d2d754166f536093002338f62105d4975b55.tar.bz2
volse-hubzilla-4a75d2d754166f536093002338f62105d4975b55.zip
Merge pull request #900 from einervonvielen/doc_dev_beginner_corrections
Changed bbcode [toc] and changed doc for beginning deveopers
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 749bc2334..9a607c80d 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) {