Skip to content

Commit

Permalink
Extend to all links starting with #
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed May 21, 2023
1 parent 3050999 commit ce39da6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/nbsphinx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1229,11 +1229,13 @@ def apply(self):
filename, fragment = _local_file_from_reference(
node, self.document)
if not filename:
if fragment == '#':
# This would work automagically in the HTML builder,
# but it is needed for LaTeX.
if fragment:
# This should not be needed if it weren't for
# https://github.com/sphinx-doc/sphinx/issues/11336 and
# https://github.com/sphinx-doc/sphinx/issues/11335
filename = os.path.basename(env.doc2path(env.docname))
fragment = ''
if fragment == '#':
fragment = ''
else:
continue

Expand Down

0 comments on commit ce39da6

Please sign in to comment.