8000 Infra: Fix Replaces/Superseded-By/Requires links for dirhtml (#2981) · python/peps@2f277a0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f277a0

Browse files
authored
Infra: Fix Replaces/Superseded-By/Requires links for dirhtml (#2981)
After #2972, when building dirhtml, we need to re-add the initial / for the links to PEPs in the Replaces/Superseded-By/Requires headers.
1 parent b4a610b commit 2f277a0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pep_sphinx_extensions/pep_processor/transforms/pep_headers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ def apply(self) -> None:
131131
new_body = []
132132
for pep_str in re.split(r",?\s+", body.astext()):
133133
target = self.document.settings.pep_url.format(int(pep_str))
134+
if self.document.settings.builder == "dirhtml":
135+
target = f"../{target}"
134136
new_body += [nodes.reference("", pep_str, refuri=target), nodes.Text(", ")]
135137
para[:] = new_body[:-1] # drop trailing space
136138
elif name == "topic":

0 commit comments

Comments
 (0)
0