Skip to content

Commit 920eed2

Browse files
committed
[singlehtml] Use same-document hyperlinks in nested/fixed reference URIs.
Relates-to commit 413e740.
1 parent 78c8b4d commit 920eed2

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,7 +52,6 @@ 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
5655
for refnode in tree.findall(nodes.reference):
5756
if 'refuri' not in refnode:
5857
continue
@@ -62,7 +61,8 @@ def fix_refuris(self, tree: Node) -> None:
6261
continue
6362
hashindex = refuri.find('#', hashindex + 1)
6463
if hashindex >= 0:
65-
refnode['refuri'] = fname + refuri[hashindex:]
64+
# all references are on the same page...
65+
refnode['refuri'] = 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)