Skip to content

Commit 314de1c

Browse files
authored
fix: generate correct URLs on Windows (#41)
1 parent 9f92ba6 commit 314de1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/DocsParser.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ export class DocsParser {
5858
isClass: boolean;
5959
}[]
6060
> {
61-
const relativeDocsPath = path.relative(this.baseElectronDir, filePath).split('.')[0];
61+
// Ensure POSIX-style path separators regardless of OS
62+
const relativeDocsPath = path
63+
.relative(this.baseElectronDir, filePath)
64+
.split(path.sep)
65+
.join(path.posix.sep)
66+
.split('.')[0];
6267
const isStructure = relativeDocsPath.includes('structures');
6368
const headings = headingsAndContent(tokens);
6469
expect(headings).to.not.have.lengthOf(

0 commit comments

Comments
 (0)