mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #2261 from mitya57/stable
transforms: Don't try to call has_child on parent nodes that are None
This commit is contained in:
commit
f2d264febe
@ -121,13 +121,13 @@ class AutoNumbering(Transform):
|
||||
if has_child(node, nodes.caption):
|
||||
self.document.note_implicit_target(node)
|
||||
elif isinstance(node, nodes.image):
|
||||
if has_child(node.parent, nodes.caption):
|
||||
if node.parent and has_child(node.parent, nodes.caption):
|
||||
self.document.note_implicit_target(node.parent)
|
||||
elif isinstance(node, nodes.table):
|
||||
if has_child(node, nodes.title):
|
||||
self.document.note_implicit_target(node)
|
||||
elif isinstance(node, nodes.literal_block):
|
||||
if has_child(node.parent, nodes.caption):
|
||||
if node.parent and has_child(node.parent, nodes.caption):
|
||||
self.document.note_implicit_target(node.parent)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user