Describe the bug.
Running npm run test:editlinks generates 404 links for some spec pages.
File: scripts/markdown/check-edit-links.ts
Proposed fixes
Dynamically detect available versions from the filesystem.
-
Resolve the specification directory at runtime (reference/specification/, derived from process.cwd()).
-
Read directory contents using Node’s fs module.
-
Detect specification versions by matching entries against a semantic version pattern:
v\d+\.\d+\.\d+ for folders, or
v\d+\.\d+\.\d+\.md for files.
- Normalize file paths (
\ → /) before comparisons so behavior is consistent across platforms.
- Pass the discovered version list to
determineEditLink, allowing it to automatically generate GitHub edit links for any valid spec version without maintaining a manual allowlist.
Expected behavior
- Files outside the ignore list are checked for broken edit links.
- Files returning 404 are logged with their file paths.
- All other links are considered valid.
Screenshots
After making the proposed changes, running npm run test:editlinks confirms that all edit links are valid
How to Reproduce
npm install
npm run test:editlinks
🖥️ Device Information [optional]
- Operating System (OS): Windows
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
Describe the bug.
Running
npm run test:editlinksgenerates 404 links for some spec pages.File:
scripts/markdown/check-edit-links.tsProposed fixes
Dynamically detect available versions from the filesystem.
Resolve the specification directory at runtime (
reference/specification/, derived fromprocess.cwd()).Read directory contents using Node’s
fsmodule.Detect specification versions by matching entries against a semantic version pattern:
v\d+\.\d+\.\d+for folders, orv\d+\.\d+\.\d+\.mdfor files.\→/) before comparisons so behavior is consistent across platforms.determineEditLink, allowing it to automatically generate GitHub edit links for any valid spec version without maintaining a manual allowlist.Expected behavior
Screenshots
After making the proposed changes, running
npm run test:editlinksconfirms that all edit links are validHow to Reproduce
npm installnpm run test:editlinks🖥️ Device Information [optional]
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!