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

Issue when jumping from H2s to H3s #27

Open
timothymcmackin opened this issue Dec 6, 2017 · 0 comments
Open

Issue when jumping from H2s to H3s #27

timothymcmackin opened this issue Dec 6, 2017 · 0 comments

Comments

@timothymcmackin
Copy link

Here's my MD file, which I'm using with Jekyll:

---
title: Testing TOC
summary: Testing TOCs.
permalink: testTOC.html
---

Lorem ipsum.

### Here's an H3
Lorem ipsum.

## Here's an H2
Lorem ipsum.

### Here's an H3
Lorem ipsum.

## Here's an H2
Lorem ipsum.

The TOC output by toc.js isn't right:

<div id="toc">
  <ul>
    <li>
      <a href="#heres-an-h3">Here’s an H3</a><a href="#heres-an-h3"></a>
    </li>
  </ul>
  <li>
    <a href="#heres-an-h2">Here’s an H2</a><a href="#heres-an-h2"></a>
    <ul>
      <li>
        <a href="#heres-an-h3-1">Here’s an H3</a><a href="#heres-an-h3-1"></a>
      </li>
    </ul>
  </li>
  <li>
    <a href="#heres-an-h2-1">Here’s an H2</a><a href="#heres-an-h2-1"></a>
  </li>
</div>

You can see that the main <ul> is closed too early, causing the results to look wrong.

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