Skip to content

Commit d5dc1db

Browse files
committed
Revert "[singlehtml] Use same-document hyperlinks in nested/fixed reference URIs."
This reverts commit 920eed2.
1 parent 56ccf3c commit d5dc1db

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sphinx/builders/singlehtml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ def get_relative_uri(self, from_: str, to: str, typ: str | None = None) -> str:
5252

5353
def fix_refuris(self, tree: Node) -> None:
5454
# fix refuris with double anchor
55+
fname = self.config.root_doc + self.out_suffix
5556
for refnode in tree.findall(nodes.reference):
5657
if 'refuri' not in refnode:
5758
continue
@@ -61,8 +62,7 @@ def fix_refuris(self, tree: Node) -> None:
6162
continue
6263
hashindex = refuri.find('#', hashindex + 1)
6364
if hashindex >= 0:
64-
# all references are on the same page...
65-
refnode['refuri'] = refuri[hashindex:]
65+
refnode['refuri'] = fname + refuri[hashindex:]
6666

6767
def _get_local_toctree(self, docname: str, collapse: bool = True, **kwargs: Any) -> str:
6868
if isinstance(includehidden := kwargs.get('includehidden'), str):

0 commit comments

Comments
 (0)