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

Empty list items in table of contents when heading structure skips a level #7128

Open
exprez135 opened this issue Apr 4, 2020 · 4 comments

Comments

@exprez135
Copy link

What version of Hugo are you using (hugo version)?

v0.68.3 on macOS via HomeBrew

Does this issue reproduce with the latest release?

Yes.


Whenever I enable the Table Of Contents in a situation without any endLevel specified in the site configuration:

Extra-Curriculars

Heading Four Here without Heading Three Before It

Technology

Heading Four Here without Heading Three Before It

The Table of Contents comes out looking like this:
image

I believe the expected behaviour would be for no extra bullet point to appear (or to appear with the H4).

If I add an H3:

Extra-Curriculars

Testing

Heading Four Here

Technology

Heading Four Here without Heading Three Before It

then:
image

Work-Around

If I manually set an endLevel, the problem disappears. It is only when one is not set that the problems occur.

@exprez135
Copy link
Author

Related support thread I opened on the forum: https://discourse.gohugo.io/t/requesting-help/9132.

@stale
Copy link

stale bot commented Aug 3, 2020

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Aug 3, 2020
@stale stale bot closed this as completed Sep 2, 2020
@jmooring
Copy link
Member

jmooring commented Sep 2, 2020

Please re-open.

To reproduce:

git clone --single-branch -b hugo-github-issue-7128 https://github.com/jmooring/hugo-testing hugo-github-issue-7128
cd hugo-github-issue-7128
hugo server

Contrary to the original report, the following does not resolve the problem:

[markup.tableOfContents]
endLevel = 3
ordered = false
startLevel = 2

Related: https://discourse.gohugo.io/t/24460

@jmooring
Copy link
Member

jmooring commented Sep 5, 2020

Please re-open.

@moorereason moorereason reopened this Mar 13, 2021
@stale stale bot removed the Stale label Mar 13, 2021
@jmooring jmooring changed the title Table of Contents Headings Empty list items in table of contents when heading structure skips a level Mar 26, 2022
@jmooring jmooring added the Bug label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants