Skip to content

Commit 52f696c

Browse files
committed
fixup!
1 parent b2d29aa commit 52f696c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/generators/metadata/utils/parse.mjs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
'use strict';
22

3-
import { basename } from 'node:path';
3+
import { basename, sep } from 'node:path';
44

5+
import { slug } from 'github-slugger';
56
import { u as createTree } from 'unist-builder';
67
import { findAfter } from 'unist-util-find-after';
78
import { remove } from 'unist-util-remove';
89
import { selectAll } from 'unist-util-select';
910
import { SKIP, visit } from 'unist-util-visit';
1011

11-
import createNodeSlugger, { slug } from './slugger.mjs';
12+
import createNodeSlugger from './slugger.mjs';
1213
import { transformNodeToHeading } from './transformers.mjs';
1314
import {
1415
visitLinkReference,
@@ -43,7 +44,7 @@ export const parseApiDoc = ({ path, tree }, typeMap) => {
4344
const nodeSlugger = createNodeSlugger();
4445

4546
// Slug the API (We use a non-class slugger, since we are fairly certain that `path` is unique)
46-
const api = slug(path);
47+
const api = slug(path.replace(sep, '-'));
4748

4849
// Get all Markdown Footnote definitions from the tree
4950
const markdownDefinitions = selectAll('definition', tree);

0 commit comments

Comments
 (0)