Merge pull request #8076 from tk0miya/6914_wrong_numfig

Fix #6914: figure numbers are unexpectedly assigned to uncaptioned items
This commit is contained in:
Takeshi KOMIYA
2020-10-04 15:52:13 +09:00
committed by GitHub
2 changed files with 5 additions and 0 deletions

View File

@@ -49,6 +49,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