Skip to content

Duplicate headers out-of-toc are not accounted for when generating links #43

@diogotcorreia

Description

@diogotcorreia

Simple example:

# Header A

```toc
```

## Header B

## Header A

Gatsby generates permalinks header-a for the first one, and header-a-1 for the third one.
However, when using this plugin (and with the default from-header: 2), the generated TOC has link header-a for the third header (while it should be header-a-1).

I'm not sure if this can be fixed here or if it has to be fixed upstream at mdast-util-toc.

See also: leic-pt/resumos-leic#1021

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