Merge pull request #5332 from tk0miya/5325_latex_broken_xref

Fix #5325: latex: cross references has been broken by multiply labeled objects
This commit is contained in:
Takeshi KOMIYA 2018-08-22 22:40:10 +09:00 committed by GitHub
commit e7e1ffe6dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -17,6 +17,7 @@ Bugs fixed
----------
* html: search box overrides to other elements if scrolled
* #5325: latex: cross references has been broken by multiply labeled objects
Testing
--------

View File

@ -1858,8 +1858,11 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.body.append(self.hypertarget(id, anchor=anchor))
# skip if visitor for next node supports hyperlink
next_node = node
while isinstance(next_node, nodes.target):
next_node = next_node.next_node(ascend=True)
domain = self.builder.env.get_domain('std')
next_node = node.next_node(ascend=True)
if isinstance(next_node, HYPERLINK_SUPPORT_NODES):
return
elif domain.get_enumerable_node_type(next_node) and domain.get_numfig_title(next_node):