Closed
Description
For the given HTML:
<h1>Depth 1</h1>
<h2>Depth 2</h2>
<h3>Depth 3</h3>
<h4>Depth 4</h4>
<h5>Depth 5</h5>
<h3>Depth 3</h3>
<h2>Depth 2</h2>
And ToCify configured thus:
var toc = $("#toc").tocify({ selectors: "h2, h3, h4, h5" }).data("toc-tocify");
The generated menu will incorrectly nest the second Depth 3 as a sibling to Depth 4, rather than as a sibling to Depth 3.
I believe in the unminised code the bug is on line 411, but I don't know how to fix it.