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:
Takeshi KOMIYA 2020-08-08 21:20:55 +09:00
parent d8cb7aa4f6
commit 66dda1fc50
2 changed files with 5 additions and 0 deletions

View File

@ -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
-------- --------

View File

@ -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