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:
Théo LUDWIG 2024-01-11 23:11:53 +01:00
parent 24a0788d32
commit a5deae599a

View File

@ -49,7 +49,9 @@ const customRule = {
if (hrefSrc != null) { if (hrefSrc != null) {
const url = new URL(hrefSrc, pathToFileURL(params.name)) const url = new URL(hrefSrc, pathToFileURL(params.name))
const isRelative = const isRelative =
url.protocol === "file:" && !hrefSrc.startsWith("/") url.protocol === "file:" &&
!hrefSrc.startsWith("/") &&
!hrefSrc.startsWith("#")
if (isRelative) { if (isRelative) {
const detail = `"${hrefSrc}"` const detail = `"${hrefSrc}"`