2018-08-06 | Paul Boddie | raw files shortlog changelog graph | Support spaced list items by disregarding empty lines as item terminators. Changed the expected representation for test data where empty lines would have been interpreted as paragraph breaks following lists. | |
moinformat/parsers/moin.py (file) tests/test_lists2.tree (file) |
1.1 --- a/moinformat/parsers/moin.py Mon Aug 06 15:52:38 2018 +0200 1.2 +++ b/moinformat/parsers/moin.py Mon Aug 06 20:09:39 2018 +0200 1.3 @@ -703,7 +703,8 @@ 1.4 # ws... 1.5 1.6 "listitemend" : join((r"^", # next line 1.7 - choice((excl(r"\N"), # without indent 1.8 + choice((expect(r"[^\s]"), # without indent 1.9 + expect(r"\Z"), # end of string 1.10 expect(r"\N+\*"), # or with ws... list-marker 1.11 expect(r"\N+\d\."), # or with ws... decimal-marker 1.12 expect(r"\N+[aA]\."), # or with ws... alpha-marker
2.1 --- a/tests/test_lists2.tree Mon Aug 06 15:52:38 2018 +0200 2.2 +++ b/tests/test_lists2.tree Mon Aug 06 20:09:39 2018 +0200 2.3 @@ -4,7 +4,6 @@ 2.4 List 2.5 ListItem 2.6 Text 2.7 - Break 2.8 List 2.9 ListItem 2.10 Text 2.11 @@ -30,7 +29,6 @@ 2.12 List 2.13 ListItem 2.14 Text 2.15 - Break 2.16 List 2.17 ListItem 2.18 Text 2.19 @@ -46,12 +44,10 @@ 2.20 List 2.21 ListItem 2.22 Text 2.23 - Break 2.24 List 2.25 ListItem 2.26 Text 2.27 ListItem 2.28 Text 2.29 - Break 2.30 Block 2.31 Text