theoludwig / markdownlint-rule-relative-links

Custom rule for markdownlint to validate relative links.
https://www.npmjs.com/package/markdownlint-rule-relative-links
MIT License
8 stars 1 forks source link

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

Closed theoludwig closed 1 month ago

theoludwig commented 4 months ago

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: https://github.com/DavidAnson/markdownlint/pull/1117#discussion_r1477542452

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.

theoludwig commented 4 months ago

(issue considered as "good first issue", as it should be a relatively straightforward/easy change even with its BREAKING CHANGE nature)

github-actions[bot] commented 1 month ago

:tada: This issue has been resolved in version 3.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: