8000 Duplicated heading texts should have a unique ID to generate expected anchor link · Issue #527 · primer/doctocat · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Duplicated heading texts should have a unique ID to generate expected anchor link #527
Open
@khiga8

Description

@khiga8

When a page has duplicated heading text, they end up generating the same anchor link. This is confusing because if I share an anchor link to a section of a page, it end up somewhere unexpected.

There's a markdownlint rule to flag duplicate heading text, but I think a more bullet-proof solution would be to update the doc parser to handle duplicate heading text.

Similar to the approach that github.com takes, could we append -1 to the ID and increment from there when the same heading text is seen?

It looks like ID is being set here in MarkdownHeading.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0