Skip to content

Commit

Permalink
Revert "[singlehtml] Use same-document hyperlinks in nested/fixed ref…
Browse files Browse the repository at this point in the history
…erence URIs."

This reverts commit 920eed2.
  • Loading branch information
jayaddison committed Jul 17, 2024
1 parent 56ccf3c commit d5dc1db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinx/builders/singlehtml.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def get_relative_uri(self, from_: str, to: str, typ: str | None = None) -> str:

def fix_refuris(self, tree: Node) -> None:
# fix refuris with double anchor
fname = self.config.root_doc + self.out_suffix
for refnode in tree.findall(nodes.reference):
if 'refuri' not in refnode:
continue
Expand All @@ -61,8 +62,7 @@ def fix_refuris(self, tree: Node) -> None:
continue
hashindex = refuri.find('#', hashindex + 1)
if hashindex >= 0:
# all references are on the same page...
refnode['refuri'] = refuri[hashindex:]
refnode['refuri'] = fname + refuri[hashindex:]

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

0 comments on commit d5dc1db

Please sign in to comment.