Skip to content

Commit a9f2e90

Browse files
Update pep_sphinx_extensions/pep_theme/templates/not_found.html
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
1 parent baa9106 commit a9f2e90

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pep_sphinx_extensions/pep_theme/templates/not_found.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
<link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
1414
<meta name="description" content="Python Enhancement Proposals (PEPs)"/>
1515
<script>
16-
const prefixNum = window.location.pathname.slice(1).replace(/^(\d*)$/, "$1")
17-
if (!isNaN(+prefixNum)) window.location.pathname = "/pep-" + prefixNum.padStart(4, "0")
16+
const match = window.location.pathname.match(/pep-(\d+)/)
17+
if (match != null) {
18+
const pepNum = match[1]
19+
window.location.pathname = "/pep-" + pepNum.padStart(4, "0")
20+
}
1821
</script>
1922
</head>
2023
<body>

0 commit comments

Comments
 (0)