diff options
author | Mario <mario@mariovavti.com> | 2022-01-11 09:17:39 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2022-01-11 09:17:39 +0000 |
commit | f8149face55ecd720ef182c67c9c1aca7af4c2fe (patch) | |
tree | 944a1c43d2c0ea9d6939cd60a7ab3d7a4210dfb7 /include/bbcode.php | |
parent | 7e2aecd8bb279bccc09edb6e107d1bb834971aa1 (diff) | |
download | volse-hubzilla-f8149face55ecd720ef182c67c9c1aca7af4c2fe.tar.gz volse-hubzilla-f8149face55ecd720ef182c67c9c1aca7af4c2fe.tar.bz2 volse-hubzilla-f8149face55ecd720ef182c67c9c1aca7af4c2fe.zip |
toc: add headings
Diffstat (limited to 'include/bbcode.php')
-rw-r--r-- | include/bbcode.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/bbcode.php b/include/bbcode.php index fd92af61e..03115effe 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -1400,7 +1400,7 @@ function bbcode($Text, $options = []) { // Check for table of content without params while(strpos($Text,'[toc]') !== false) { $toc_id = 'toc-' . random_string(10); - $Text = preg_replace("/\[toc\]/ism", '<ul id="' . $toc_id . '" class="toc"></ul><script>$(document).ready(function() { let toc_container = $("#' . $toc_id . '").parent().closest("div").attr("id") || ".section-content-wrapper"; $("#' . $toc_id . '").toc({content: "#" + toc_container}); });</script>', $Text, 1); + $Text = preg_replace("/\[toc\]/ism", '<ul id="' . $toc_id . '" class="toc"></ul><script>$(document).ready(function() { let toc_container = $("#' . $toc_id . '").parent().closest("div").attr("id") || ".section-content-wrapper"; $("#' . $toc_id . '").toc({content: "#" + toc_container, headings: "h1,h2,h3,h4"}); });</script>', $Text, 1); } // Check for table of content with params while(strpos($Text,'[toc') !== false) { |