Skip to content

[Feature] Stricter validation of heading fragments by being Case sensitive. #8

@theoludwig

Description

@theoludwig

Description

Currently, the rule doesn't report an error for the following:

├── file1.md
└── file2.md

With file1.md content:

## Existing Heading

With file2.md content:

[Link](./file1.md#ExistIng-Heading)

Whereas, we should report an error, to enforce consistency with the built-in markdownlint rule - MD051.
More explanations there: DavidAnson/markdownlint#1117 (comment)

Describe the solution you'd like

The rule should reports an error, saying that it's an invalid link fragment, as with the above example, the link should have been: [Link](./file1.md#existing-heading).

There is a test fixture to ensures that we don't consider as errors, the links fragments with mixed casing: https://github.com/theoludwig/markdownlint-rule-relative-links/tree/develop/test/fixtures/valid/existing-heading-case-insensitive, we should instead move it to "invalid", and make the test pass. However, this change should be considered as a BREAKING CHANGE.

Describe alternatives you've considered

Continue to consider heading links fragments valid even if the link fragment is not only in lowercase, with mixed case for example.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions