Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@exprez135

Description

@exprez135

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions