Fix #7090: std domain: Can't assign numfig-numbers for custom container nodes

This commit is contained in:
Takeshi KOMIYA 2020-02-02 22:51:23 +09:00
parent 67651ab8ec
commit b1bde4f21e
2 changed files with 6 additions and 5 deletions

View File

@ -78,6 +78,7 @@ Bugs fixed
module members without :impoprted-members: option module members without :impoprted-members: option
* #6889: autodoc: Trailing comma in ``:members::`` option causes cryptic warning * #6889: autodoc: Trailing comma in ``:members::`` option causes cryptic warning
* #7055: linkcheck: redirect is treated as an error * #7055: linkcheck: redirect is treated as an error
* #7090: std domain: Can't assign numfig-numbers for custom container nodes
Testing Testing
-------- --------

View File

@ -925,11 +925,11 @@ class StandardDomain(Domain):
if isinstance(node, nodes.section): if isinstance(node, nodes.section):
return 'section' return 'section'
elif isinstance(node, nodes.container): elif (isinstance(node, nodes.container) and
if node.get('literal_block') and has_child(node, nodes.literal_block): 'literal_block' in node and
return 'code-block' has_child(node, nodes.literal_block)):
else: # given node is a code-block having caption
return None return 'code-block'
else: else:
figtype, _ = self.enumerable_nodes.get(node.__class__, (None, None)) figtype, _ = self.enumerable_nodes.get(node.__class__, (None, None))
return figtype return figtype