diff --git a/sphinx_js/renderers.py b/sphinx_js/renderers.py index 61cc5df8..c70ffe63 100644 --- a/sphinx_js/renderers.py +++ b/sphinx_js/renderers.py @@ -471,16 +471,16 @@ def _fields(self, obj: TopLevel) -> Iterator[tuple[list[str], str]]: for collection_attr, callback in FIELD_TYPES: for instance in getattr(obj, collection_attr, []): result = callback(instance) - if result: - heads, tail = result - # If there are line breaks in the tail, the RST parser will - # end the field list prematurely. - # - # TODO: Instead, indent multi-line tails juuuust right, and - # we can enjoy block-level constructs within tails: - # https://docutils.sourceforge.io/docs/ref/rst/ - # restructuredtext.html#field-lists. - yield [rst.escape(h) for h in heads], unwrapped(tail) + if not result: + continue + heads, tail = result + # If there are line breaks in the tail, the RST parser will + # end the field list prematurely. + # + # TODO: Instead, indent multi-line tails juuuust right, and + # we can enjoy block-level constructs within tails: + # https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#field-lists. + yield [rst.escape(h) for h in heads], unwrapped(tail) class AutoFunctionRenderer(JsRenderer):