sphinx-autodoc-typehints
sphinx-autodoc-typehints copied to clipboard
Return type + docstring `container` directive generates error
sphinx-autodoc-typehints generates an error and a warning when processing this function:
def foo() -> int:
"""
Description.
.. container::
More description.
"""
return
/path/to/file:5: ERROR: Content block expected for the "container" directive; none found. [docutils]
/path/to/file:6: WARNING: Explicit markup ends without a blank line; unexpected unindent. [docutils]
The bug is triggered when these two things are true:
- the function annotates a return type
- the function's docstring contains a
containerdirective
This is with sphinx-autodoc-typehints 2.5.0, but I think a version of this bug (always triggered by a container directive) has been around since at least February 2023.