Skip to content

[Proposal] Rule to disallow links in headings #1308

@Arty-chan

Description

@Arty-chan

A lot of markdown renderers on sites auto-create anchor links to headings.

While if there is a link in a heading, the anchor will still work, clicking on the heading can lead you to the specified link instead of giving you the anchor link. This disrupts the default behaviour of the heading.

It's particularly problematic in something that is generated off the headings. For example, if you have a table of contents generated from the headings, many generators will not strip out the link, so when you click on the heading in the table of contents, it goes to the specified link instead of to the heading on the current page.

I'm creating a custom rule in another linter (vale) so it's not a priority for me, but thought this would be a good idea to include as a rule in markdownlint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions