Skip to content

Commit 5fd9dac

Browse files
committed
Line ending with : is assumed to require force newline
1 parent 494f6b9 commit 5fd9dac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/lazydocs/generation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,11 @@ def _lines_isvalid(lines: list, start_index: int, blockindent: int,
613613
out.append(line.replace("\n",
614614
"\n" + " " * padding))
615615
elif line:
616+
# Assume require force markdown newline if line ends with ":"
617+
if line.endswith(":") and \
618+
not any([md_code_snippet, literal_block, doctest_block]):
619+
line = line + " "
620+
616621
padding = max(indent - blockindent + offset, 0)
617622
out.append(" " * padding
618623
+ line.replace("\n",

0 commit comments

Comments
 (0)