From b876af6c305a0f99d5daec15241d01720ed63349 Mon Sep 17 00:00:00 2001 From: Sylvain Gugger Date: Fri, 29 Apr 2022 16:49:13 -0400 Subject: [PATCH] Fix example formatting --- src/doc_builder/style_doc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc_builder/style_doc.py b/src/doc_builder/style_doc.py index 9ee74f26..28949912 100644 --- a/src/doc_builder/style_doc.py +++ b/src/doc_builder/style_doc.py @@ -161,7 +161,7 @@ def format_code_example(code: str, max_len: int, in_docstring: bool = False): if has_doctest and not is_empty_line(line): prefix = ( "... " - if line.startswith(" ") or line in [")", "]", "}"] or in_triple_quotes or in_decorator + if line.startswith(" ") or line[0] in [")", "]", "}"] or in_triple_quotes or in_decorator else ">>> " ) else: