fix: ignore external https image links

This commit is contained in:
2026-02-05 21:12:22 +01:00
parent 211c71d75b
commit c744c4872a
3 changed files with 23 additions and 3 deletions
+15 -2
View File
@@ -70,11 +70,24 @@ const relativeLinksRule = {
url = new URL(hrefSrc, pathToFileURL(params.name))
}
if (url.protocol !== "file:" && type !== "image") {
const detail = `"${hrefSrc}"`
if (
type === "image" &&
url.protocol !== "file:" &&
url.protocol !== "http:" &&
url.protocol !== "https:"
) {
onError({
lineNumber,
detail: `${detail} should be an image`,
})
continue
}
const detail = `"${hrefSrc}"`
if (url.protocol !== "file:") {
continue
}
if (!fs.existsSync(url)) {
onError({