dashaluna / hm-content-toc

WordPress plugin. Creates content TOC (table of contents) for specified header elements from the current post/page content. Adds anchor elements in the content just before the matched headers.
GNU General Public License v2.0
9 stars 6 forks source link

Hierarchical TOC structure #38

Open dashaluna opened 9 years ago

dashaluna commented 9 years ago

…play TOC - flat or nested list. TODO: nested list doens't quite work

Issue #23

dashaluna commented 9 years ago

@tcrsavage I've used your code for the nested TOC structure. I've edited it to work with real headers and TOC items array.. and managed to break it - oops.

Here is the example post content that I was testing on and headers h3 don't seem to be nested correctly. Was wondering if you could have a look at it with me as I'm a bit stuck. Thanks :)

[hm_content_toc title="The TOC" headers="h2, h3, h4, h5, h6" type="nested"]
<h2>Header's 2</h2>
Some text here. Some text here. Some text here.
<h3>Header= 3</h3>
Some text here. Some text here. Some text here.
<h3>Header= 3</h3>
Some text here. Some text here. Some text here.
<h3>Header= 3</h3>
Some text here. Some text here. Some text here.
<h3>Header= 3</h3>
Some text here. Some text here. Some text here.
<h5>Header's 5</h5>
Some text here. Some text here. Some text here.
<h2>Header 2</h2>
Some text here. Some text here. Some text here.
<h3>Header 3</h3>
Some text here. Some text here. Some text here.
<h4>Header. 4;</h4>
Some text here. Some text here. Some text here.
<h3>Header 3</h3>
Some text here. Some text here. Some text here.