starlight-links-validator 0.4.0 → 0.4.1

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 +3 -2
  2. package/package.json +1 -1
package/libs/remark.ts CHANGED
@@ -2,7 +2,7 @@ import 'mdast-util-mdx-jsx'
2
2
 
3
3
  import nodePath from 'node:path'
4
4
 
5
- import { slug } from 'github-slugger'
5
+ import GitHubSlugger, { slug } from 'github-slugger'
6
6
  import type { Nodes } from 'hast'
7
7
  import { fromHtml } from 'hast-util-from-html'
8
8
  import { hasProperty } from 'hast-util-has-property'
@@ -19,6 +19,7 @@ const links: Links = new Map()
19
19
 
20
20
  export const remarkStarlightLinksValidator: Plugin<[], Root> = function () {
21
21
  return (tree, file) => {
22
+ const slugger = new GitHubSlugger()
22
23
  const filePath = normalizeFilePath(file.history[0])
23
24
 
24
25
  const fileHeadings: string[] = []
@@ -35,7 +36,7 @@ export const remarkStarlightLinksValidator: Plugin<[], Root> = function () {
35
36
  break
36
37
  }
37
38
 
38
- fileHeadings.push(slug(content))
39
+ fileHeadings.push(slugger.slug(content))
39
40
 
40
41
  break
41
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starlight-links-validator",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "license": "MIT",
5
5
  "description": "Astro integration for Starlight to validate internal links.",
6
6
  "author": "HiDeoo <github@hideoo.dev> (https://hideoo.dev)",