mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #6914: figure numbers are unexpectedly assigned to uncaptioned items
The figure numbers should be assigned to items only having captions or titles. This uses `get_numfig_title()` to ensures it on assign numbers.
This commit is contained in:
parent
d8cb7aa4f6
commit
66dda1fc50
1
CHANGES
1
CHANGES
@ -47,6 +47,7 @@ Bugs fixed
|
|||||||
singlehtml and so on)
|
singlehtml and so on)
|
||||||
* #8239: Failed to refer a token in productionlist if it is indented
|
* #8239: Failed to refer a token in productionlist if it is indented
|
||||||
* #8268: linkcheck: Report HTTP errors when ``linkcheck_anchors`` is ``True``
|
* #8268: linkcheck: Report HTTP errors when ``linkcheck_anchors`` is ``True``
|
||||||
|
* #6914: figure numbers are unexpectedly assigned to uncaptioned items
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
|
@ -224,6 +224,10 @@ class TocTreeCollector(EnvironmentCollector):
|
|||||||
def get_figtype(node: Node) -> str:
|
def get_figtype(node: Node) -> str:
|
||||||
for domain in env.domains.values():
|
for domain in env.domains.values():
|
||||||
figtype = domain.get_enumerable_node_type(node)
|
figtype = domain.get_enumerable_node_type(node)
|
||||||
|
if domain.name == 'std' and not domain.get_numfig_title(node): # type: ignore
|
||||||
|
# Skip if uncaptioned node
|
||||||
|
continue
|
||||||
|
|
||||||
if figtype:
|
if figtype:
|
||||||
return figtype
|
return figtype
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user