mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #611: latex writer raised IndexError on pages with no section but a link target.
This commit is contained in:
parent
1f59194ee3
commit
a4b8b81712
@ -1048,8 +1048,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
next = node.parent[parindex+1]
|
||||
except IndexError:
|
||||
# last node in parent, look at next after parent
|
||||
# (for section of equal level)
|
||||
next = node.parent.parent[node.parent.parent.index(node.parent)]
|
||||
# (for section of equal level) if it exists
|
||||
if node.parent.parent is not None:
|
||||
next = node.parent.parent[
|
||||
node.parent.parent.index(node.parent)]
|
||||
else:
|
||||
raise
|
||||
if isinstance(next, nodes.section):
|
||||
if node.get('refid'):
|
||||
self.next_section_ids.add(node['refid'])
|
||||
|
Loading…
Reference in New Issue
Block a user