doc: wikiparser: Allow empty lines between list items

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2020-08-25 14:02:22 -07:00 committed by James Valleroy
parent 9bb518cc76
commit 3aca4cd164
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -928,6 +928,10 @@ List('numbered', [ListItem([Paragraph([PlainText('item 1.1')])])])])])]
[List('bulleted', \
[ListItem([Paragraph([PlainText('single,'), \
PlainText('multiline item')])])])]
>>> parse_wiki(' * single,\\n \\n multipara item')
[List('bulleted', \
[ListItem([Paragraph([PlainText('single,')]), \
Paragraph([PlainText('multipara item')])])])]
>>> parse_wiki('----')
[HorizontalRule(4)]
@ -1300,6 +1304,11 @@ PlainText('dialog.')])])])]
top_indent = len(match.group(1))
while lines:
candidate = lines[0]
if re.match(r'^ *$', candidate):
# Eat up empty lines
next_list_item += '\n' + lines.pop(0)
continue
if not candidate.startswith(' ' * top_indent):
# Not part of list
break