Skip to content

Hyperlinks in headers break their ToC entries #43

@Expurple

Description

@Expurple

Sorry if this is an issue with Hugo and not the theme. I'm not sure what's responsible for what.

Describe the bug

By themselves, hyperlinks in headers are functional. But they generate weird ToC entries.

Reproducible example

## Example [hyperlink](https://example.com/) in a header

generates a split-up ToC entry.

The left end takes you to the header (as expected):

Image

The middle part doesn't look like a hyperlink, but it's a separate hyperlink that takes you to an external website:

Image

Finally, the right part doesn't work. It's just nornal text that doesn't take you anywhere:

Image

Expected behavior

Normally, a ToC entry is a one big hyperlink takes you to the header:

Image

This is the most obvious behavior that I can imagine for my reproducer.

Another possible option to keep it "split" but fix the right end (so that it takes you to the header) and underline the middle part (so that it looks like a hyperlink, which it is).

Desktop (please complete the following information):

  • OS: Kubuntu 24.10 (x64)
  • Browser: Firefox 134.0 (64-bit)
  • Hugo Version: 0.129.0 from the distro
  • Kayal Version: 0.3.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions