tscanlin / tocbot

Build a table of contents from headings in an HTML document.
MIT License
1.37k stars 114 forks source link

tocbot 4.18.2 is not detecting h3 #306

Closed ppazos closed 1 year ago

ppazos commented 1 year ago

I have headingSelector: 'h1, h2, h3' and it detects h1 and h2 but not h3.

ppazos commented 1 year ago

Sorry, the items are there but are hidden, only shown when I scroll to the parent h2 section, how can I display the h3 by default?

ppazos commented 1 year ago

Nevermind, just found the collapseDepth property that was what I needed.

zjplab commented 11 months ago

Add to that:

  // How many heading levels should not be collpased.
  // For example, number 6 will show everything since
  // there are only 6 heading levels and number 0 will collpase them all.
  // The sections that are hidden will open
  // and close as you scroll to headings within them.
  collapseDepth: 6,