Tweaked doce generation.

This commit is contained in:
Revar Desmera
2019-05-10 04:02:58 -07:00
parent e946031d99
commit 4efb109863
3 changed files with 27 additions and 20 deletions

View File

@@ -52,10 +52,17 @@ def mkdn_esc(txt):
def get_comment_block(lines, prefix, blanks=1):
out = []
blankcnt = 0
indent = 0
while lines:
if not lines[0].startswith(prefix + " "):
if not lines[0].startswith(prefix+" "):
break
line = lines.pop(0)[len(prefix)+1:]
line = lines.pop(0)[len(prefix):]
if not indent:
while line.startswith(" "):
line = line[1:]
indent += 1
else:
line = line[indent:]
if line == "":
blankcnt += 1
if blankcnt >= blanks: