mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #7090: std domain: Can't assign numfig-numbers for custom container nodes
This commit is contained in:
parent
67651ab8ec
commit
b1bde4f21e
1
CHANGES
1
CHANGES
@ -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
|
||||||
--------
|
--------
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user