starlight-links-validator 0.12.0 → 0.12.2

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.
Files changed (2) hide show
  1. package/libs/remark.ts +8 -4
  2. package/package.json +2 -2
package/libs/remark.ts CHANGED
@@ -134,8 +134,8 @@ export const remarkStarlightLinksValidator: Plugin<[{ base: string; srcDir: URL
134
134
  }
135
135
  })
136
136
 
137
- headings.set(getFilePath(filePath, slug), fileHeadings)
138
- links.set(getFilePath(filePath, slug), fileLinks)
137
+ headings.set(getFilePath(base, filePath, slug), fileHeadings)
138
+ links.set(getFilePath(base, filePath, slug), fileLinks)
139
139
  }
140
140
  }
141
141
 
@@ -147,8 +147,12 @@ function isInternalLink(link: string) {
147
147
  return !isAbsoluteUrl(link)
148
148
  }
149
149
 
150
- function getFilePath(filePath: string, slug: string | undefined) {
151
- return slug ? stripLeadingSlash(ensureTrailingSlash(slug)) : filePath
150
+ function getFilePath(base: string, filePath: string, slug: string | undefined) {
151
+ if (slug) {
152
+ return nodePath.posix.join(stripLeadingSlash(base), stripLeadingSlash(ensureTrailingSlash(slug)))
153
+ }
154
+
155
+ return filePath
152
156
  }
153
157
 
154
158
  function normalizeFilePath(base: string, srcDir: URL, filePath?: string) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-links-validator",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
4
4
  "license": "MIT",
5
5
  "description": "Starlight plugin to validate internal links.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",
@@ -10,6 +10,7 @@
10
10
  "./package.json": "./package.json"
11
11
  },
12
12
  "dependencies": {
13
+ "@types/picomatch": "2.3.3",
13
14
  "github-slugger": "2.0.0",
14
15
  "hast-util-from-html": "2.0.1",
15
16
  "hast-util-has-property": "3.0.0",
@@ -24,7 +25,6 @@
24
25
  "@types/hast": "3.0.3",
25
26
  "@types/mdast": "4.0.3",
26
27
  "@types/node": "18.17.18",
27
- "@types/picomatch": "2.3.3",
28
28
  "astro": "4.8.6",
29
29
  "mdast-util-mdx-jsx": "3.0.0",
30
30
  "remark-custom-heading-id": "2.0.0",