Skip to content

Commit 6761edb

Browse files
committed
Fix Colon use in docstring in arguments blocks now formatted correctly.
1 parent 15bb65a commit 6761edb

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/lazydocs/generation.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,16 @@ def _doc2md(obj: Any) -> str:
429429
argindent = indent
430430
elif arg_list and not literal_block and _RE_ARGSTART.match(line):
431431
# start of an exception-type block
432-
out.append(
433-
"\n"
434-
+ " " * blockindent
435-
+ " - "
436-
+ _RE_ARGSTART.sub(r"<b>`\1`</b>: \2", line)
437-
)
438-
argindent = indent
432+
if indent > argindent:
433+
out.append(" " + line)
434+
else:
435+
out.append(
436+
"\n"
437+
+ " " * blockindent
438+
+ " - "
439+
+ _RE_ARGSTART.sub(r"<b>`\1`</b>: \2", line)
440+
)
441+
argindent = indent
439442
elif indent > argindent:
440443
# attach docs text of argument
441444
# * (blockindent + 2)

0 commit comments

Comments
 (0)