mirror of
https://github.com/theoludwig/markdownlint-rule-relative-links.git
synced 2024-11-04 18:21:31 +01: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:
parent
24a0788d32
commit
a5deae599a
@ -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}"`
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user