Skip to content

Commit

Permalink
NFC Remove one indentation level in _fields
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Oct 1, 2023
1 parent a849633 commit 32bb950
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions sphinx_js/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 32bb950

Please sign in to comment.