mirror of
https://github.com/theoludwig/markdownlint-rule-relative-links.git
synced 2025-05-27 11:37:24 +02:00
fix: ignore checking fragment in own file
We don't need to check if fragments are valid in own file. It's already checked by the rule MD051 of markdownlint (else we have the error duplicated). Ref: https://github.com/DavidAnson/markdownlint/blob/main/doc/md051.md
This commit is contained in:
@ -49,7 +49,9 @@ const customRule = {
|
||||
if (hrefSrc != null) {
|
||||
const url = new URL(hrefSrc, pathToFileURL(params.name))
|
||||
const isRelative =
|
||||
url.protocol === "file:" && !hrefSrc.startsWith("/")
|
||||
url.protocol === "file:" &&
|
||||
!hrefSrc.startsWith("/") &&
|
||||
!hrefSrc.startsWith("#")
|
||||
if (isRelative) {
|
||||
const detail = `"${hrefSrc}"`
|
||||
|
||||
|
Reference in New Issue
Block a user