From a5deae599ab8769842d554cbf85621c8ac6b95f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Thu, 11 Jan 2024 23:11:53 +0100 Subject: [PATCH] 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 --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 4026ce1..bde6243 100644 --- a/src/index.js +++ b/src/index.js @@ -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}"`