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

<h2> TOCs rendering, but not <h3> or <h4> #32

Open
versipellis opened this issue Oct 6, 2021 · 0 comments
Open

<h2> TOCs rendering, but not <h3> or <h4> #32

versipellis opened this issue Oct 6, 2021 · 0 comments

Comments

@versipellis
Copy link

As the title states, <h2> renders fine, but <h3> and <h4> tags do not, even though they are after <h2>, and correspondingly have their own IDs.

Using the default settings:

const pluginTOC = require('eleventy-plugin-toc', {
  tags: ['h2', 'h3', 'h4'], // which heading tags are selected headings must each have an ID attribute
  wrapper: 'nav',           // element to put around the root `ol`/`ul`
  wrapperClass: 'toc',      // class for the element around the root `ol`/`ul`
  ul: false,                // if to use `ul` instead of `ol`
  flat: false,              // if subheadings should appear as child of parent or as a sibling
});

Minimum reproducible example:

---
title: Title
layout: post.njk
---
<h2 id="header-test1">test1</h2>
<h3 id="header-test2">test2</h3>
<h4 id="header-test3">test3</h4>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant