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

Don't render table of contents if there are no list items #23

Closed
4 tasks done
ZachSaucier opened this issue Nov 7, 2023 · 2 comments
Closed
4 tasks done

Don't render table of contents if there are no list items #23

ZachSaucier opened this issue Nov 7, 2023 · 2 comments
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on

Comments

@ZachSaucier
Copy link

Initial checklist

Problem

The way that this currently works, it renders this:

<nav class="toc"><ol class="toc-level toc-level-1"></ol></nav>

This is extra, unnecessary markup. Additionally, if one uses CSS to add something (I use it to add "Table of contents" before the <ol>), it shows up even there's no table of contents to see.

Solution

The whole table of contents should not be rendered if there are no <li> items.

Alternatives

I don't think there are alternatives?

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Nov 7, 2023
@ZachSaucier
Copy link
Author

Dang it, wrong repo. Sorry about that.

This comment has been minimized.

@wooorm wooorm added the 🤷 no/invalid This cannot be acted upon label Nov 7, 2023
@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants