Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incomplete TOC when nesting order is unexpected #55

Closed

Comments

@cmaas
Copy link
Owner

cmaas commented Mar 8, 2021

Source:

# A
[[toc]]
### B
## C
## D

Config:

includeLevel: [2,3]

Expected result:

<ul>
  <li>
    <ul>
      <li>B</li>
    </ul>
  </li>
  <li>C</li>
  <li>D</li>
</ul>

Actual result: Shows only heading level 3 and nothing else.

Why would anyone do this? Because personally, I think level 1 is useless in a TOC, because that is the page header. I use level 2+3 only. I also use level 3 to have a heading in some kind of info box. The markup is like this:

# Nice article
[[toc]]
Blabla
<div class="infobox">
### Did you know?
Blabla
</div>

## Headline after info box
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment