mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-05-20 10:34:30 +00:00
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:
parent
9bb518cc76
commit
3aca4cd164
@ -928,6 +928,10 @@ List('numbered', [ListItem([Paragraph([PlainText('item 1.1')])])])])])]
|
|||||||
[List('bulleted', \
|
[List('bulleted', \
|
||||||
[ListItem([Paragraph([PlainText('single,'), \
|
[ListItem([Paragraph([PlainText('single,'), \
|
||||||
PlainText('multiline item')])])])]
|
PlainText('multiline item')])])])]
|
||||||
|
>>> parse_wiki(' * single,\\n \\n multipara item')
|
||||||
|
[List('bulleted', \
|
||||||
|
[ListItem([Paragraph([PlainText('single,')]), \
|
||||||
|
Paragraph([PlainText('multipara item')])])])]
|
||||||
|
|
||||||
>>> parse_wiki('----')
|
>>> parse_wiki('----')
|
||||||
[HorizontalRule(4)]
|
[HorizontalRule(4)]
|
||||||
@ -1300,6 +1304,11 @@ PlainText('dialog.')])])])]
|
|||||||
top_indent = len(match.group(1))
|
top_indent = len(match.group(1))
|
||||||
while lines:
|
while lines:
|
||||||
candidate = lines[0]
|
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):
|
if not candidate.startswith(' ' * top_indent):
|
||||||
# Not part of list
|
# Not part of list
|
||||||
break
|
break
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user