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.
This commit is contained in:
parent
b4a610bce9
commit
2f277a0a2a
|
@ -131,6 +131,8 @@ class PEPHeaders(transforms.Transform):
|
|||
new_body = []
|
||||
for pep_str in re.split(r",?\s+", body.astext()):
|
||||
target = self.document.settings.pep_url.format(int(pep_str))
|
||||
if self.document.settings.builder == "dirhtml":
|
||||
target = f"../{target}"
|
||||
new_body += [nodes.reference("", pep_str, refuri=target), nodes.Text(", ")]
|
||||
para[:] = new_body[:-1] # drop trailing space
|
||||
elif name == "topic":
|
||||
|
|
Loading…
Reference in New Issue