mirror of
https://github.com/theoludwig/markdownlint-rule-relative-links.git
synced 2025-05-27 11:37:24 +02:00
feat: stricter validation of heading fragments by being Case sensitive
Fixes #8 BREAKING CHANGE: Heading fragments is now Case sensitive. For example "#ExistIng-Heading" is invalid as it should be "#existing-heading".
This commit is contained in:
@ -126,7 +126,7 @@ const customRule = {
|
||||
|
||||
fragmentsHTML.push(...idOrAnchorNameHTMLFragments)
|
||||
|
||||
if (!fragmentsHTML.includes(url.hash.toLowerCase())) {
|
||||
if (!fragmentsHTML.includes(url.hash)) {
|
||||
if (url.hash.startsWith("#L")) {
|
||||
const lineNumberFragmentString = getLineNumberStringFromFragment(
|
||||
url.hash,
|
||||
@ -157,6 +157,8 @@ const customRule = {
|
||||
})
|
||||
continue
|
||||
}
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
onError({
|
||||
|
@ -28,7 +28,7 @@ const convertHeadingToHTMLFragment = (inlineText) => {
|
||||
"",
|
||||
)
|
||||
.replace(/ /gu, "-"),
|
||||
).toLowerCase()
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user