nuxt-link-checker 2.0.0-beta.8 → 2.0.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "linkChecker",
8
- "version": "2.0.0-beta.8"
8
+ "version": "2.0.0-beta.9"
9
9
  }
package/dist/module.mjs CHANGED
@@ -185,7 +185,7 @@ function inspect(ctx, rules = DefaultInspections) {
185
185
  const res = { error: [], warning: [], fix: ctx.link, link: ctx.link };
186
186
  let link = ctx.link;
187
187
  const url = parseURL(link);
188
- if (!url.pathname && !url.protocol && !url.host && !link.startsWith("javascript:")) {
188
+ if (!url.pathname && !url.protocol && !url.host && !isInvalidLinkProtocol(link) && !link.startsWith("mailto:") && !link.startsWith("#")) {
189
189
  res.error.push({
190
190
  name: "invalid-url",
191
191
  scope: "error",
@@ -6,6 +6,7 @@ import RuleNoJavascript from "./inspections/no-javascript.mjs";
6
6
  import RuleAbsoluteSiteUrls from "./inspections/absolute-site-urls.mjs";
7
7
  import RuleRedirects from "./inspections/redirects.mjs";
8
8
  import RuleNoErrorResponse from "./inspections/no-error-response-status.mjs";
9
+ import { isInvalidLinkProtocol } from "./inspections/util.mjs";
9
10
  export const DefaultInspections = {
10
11
  "missing-hash": RuleMissingHash(),
11
12
  "no-error-response": RuleNoErrorResponse(),
@@ -19,7 +20,7 @@ export function inspect(ctx, rules = DefaultInspections) {
19
20
  const res = { error: [], warning: [], fix: ctx.link, link: ctx.link };
20
21
  let link = ctx.link;
21
22
  const url = parseURL(link);
22
- if (!url.pathname && !url.protocol && !url.host && !link.startsWith("javascript:")) {
23
+ if (!url.pathname && !url.protocol && !url.host && !isInvalidLinkProtocol(link) && !link.startsWith("mailto:") && !link.startsWith("#")) {
23
24
  res.error.push({
24
25
  name: "invalid-url",
25
26
  scope: "error",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nuxt-link-checker",
3
3
  "type": "module",
4
- "version": "2.0.0-beta.8",
4
+ "version": "2.0.0-beta.9",
5
5
  "packageManager": "pnpm@8.6.11",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",