Skip to content

Commit 447cde2

Browse files
Fix (#43)
1 parent 1dfe597 commit 447cde2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/docs/404.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ window.onload = function () {
1818
window.location.replace('/' + latest_dir_name + '/' + path.slice(path.length == 7 ? 7 : 8))
1919
}
2020
// redirect a semver (/2.0.1) to a directory name (/2_0)
21-
let parts = path.match(/^\\/([0-9]+)\\.([0-9])+\\.[0-9]+(\\/.*)?$/)?.groups;
21+
let parts = path.match(/^\\/(?<major>[0-9]+)\\.(?<minor>[0-9])+\\.[0-9]+(?<rest>\\/.*)?$/)?.groups;
2222
if (parts) {
23-
window.location.replace('/' + parts[1] + '_' + parts[2] + parts[3] || '')
23+
window.location.replace('/' + parts['major'] + '_' + parts['minor'] + parts['rest'] || '')
2424
}
2525
};
2626
`}</script>

0 commit comments

Comments
 (0)