Skip to content

Commit 494f6b9

Browse files
committed
Fix rendering of multiline docstring summary
1 parent 2ed3431 commit 494f6b9

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/lazydocs/generation.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,15 @@ def _get_src_root_path(obj: Any) -> str:
361361

362362

363363
def _get_doc_summary(obj: Any) -> str:
364-
# First line should contain the summary
365-
return _get_docstring(obj).split("\n")[0]
364+
# Summary should continue until blank space
365+
summary = []
366+
for line in _get_docstring(obj).split("\n"):
367+
if line == "" or line is None:
368+
break
369+
if line.endswith(" "):
370+
line = f"{line}\n"
371+
summary.append(line.lstrip())
372+
return " ".join(summary)
366373

367374

368375
def _get_anchor_tag(header: str) -> str:

0 commit comments

Comments
 (0)