aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRedMatrix <info@friendica.com>2015-01-15 11:22:57 +1100
committerRedMatrix <info@friendica.com>2015-01-15 11:22:57 +1100
commitb37915a40e4e049072698e604e61798445a339de (patch)
tree8442b35b92920a759f6b9e67030b8f151114e648 /include
parentd6ae124bbd549629ec7d76bb1b1555d1344ac8b4 (diff)
parentdfab2416926631b7b08c6c89b62528ca2520f130 (diff)
downloadvolse-hubzilla-b37915a40e4e049072698e604e61798445a339de.tar.gz
volse-hubzilla-b37915a40e4e049072698e604e61798445a339de.tar.bz2
volse-hubzilla-b37915a40e4e049072698e604e61798445a339de.zip
Merge pull request #850 from einervonvielen/toc
Added a table of content as bbcode element [toc] for webpages
Diffstat (limited to 'include')
-rw-r--r--include/bbcode.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 030a1fb49..33017c011 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -575,6 +575,10 @@ 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
+ if (strpos($Text,'[toc]') !== false) {
+ $Text = preg_replace("/\[toc\]/ism",'<ul id="toc"></ul>',$Text);
+ }
// Check for centered text
if (strpos($Text,'[/center]') !== false) {
$Text = preg_replace("(\[center\](.*?)\[\/center\])ism","<div style=\"text-align:center;\">$1</div>",$Text);