# HG changeset patch # User Paul Boddie # Date 1635204752 -7200 # Node ID 4b86f7f894b80acf091ffc427470946588d143a6 # Parent 6af6b0d9c9a96f3649f7b609d8ed2c19f1c7f2cb Fixed table feature padding patterns to consume only a single line. diff -r 6af6b0d9c9a9 -r 4b86f7f894b8 moinformat/parsers/table.py --- a/moinformat/parsers/table.py Mon Oct 25 23:03:10 2021 +0200 +++ b/moinformat/parsers/table.py Tue Oct 26 01:32:32 2021 +0200 @@ -114,25 +114,25 @@ syntax.update({ # At start of line: - "rowsep" : join((group("leading", r"\s*"), # ws... (optional) - "^==", # == - excl(r".*==\s*?$"), # not-heading - group("padding", r"\s*"))), # ws... (optional) + "rowsep" : join((group("leading", r"\s*"), # ws... (optional) + "^==", # == + excl(r".*==\s*?$"), # not-heading + group("padding", r"\N*\n?"))), # ws-excl-nl... nl (optional) "continuation" : group("feature", - join((group("leading", r"\s*"), # ws... (optional) + join((group("leading", r"\s*"), # ws... (optional) "^", - group("indent", r"\s*"), # ws... (optional) - r"\.\.", # .. - excl(r"\."), # not-. - group("padding", r"\s*")))),# ws... (optional) + group("indent", r"\s*"), # ws... (optional) + r"\.\.", # .. + excl(r"\."), # not-. + group("padding", r"\N*")))), # ws-excl-nl... (optional) # Within text: - "columnsep" : join((group("leading", r"\s*"), # ws... (optional) - r"\|\|", # || - excl(r"\|"), # not-| - group("padding", r"\s*"))), # ws... (optional) + "columnsep" : join((group("leading", r"\s*"), # ws... (optional) + r"\|\|", # || + excl(r"\|"), # not-| + group("padding", r"\N*\n?"))), # ws-excl-nl... nl (optional) }) patterns = get_patterns(syntax) diff -r 6af6b0d9c9a9 -r 4b86f7f894b8 tests/test_table_parser.tree --- a/tests/test_table_parser.tree Mon Oct 25 23:03:10 2021 +0200 +++ b/tests/test_table_parser.tree Tue Oct 26 01:32:32 2021 +0200 @@ -75,4 +75,37 @@ TableCell Block Text + Break + Region + Table + TableRow + TableCell + List + ListItem + Text + ListItem + Text + Block + TableCell + List + ListItem + Text + ListItem + Text + Block + TableRow + TableCell + List + ListItem + Text + ListItem + Text + Block + TableCell + List + ListItem + Text + ListItem + Text + Block Block diff -r 6af6b0d9c9a9 -r 4b86f7f894b8 tests/test_table_parser.txt --- a/tests/test_table_parser.txt Mon Oct 25 23:03:10 2021 +0200 +++ b/tests/test_table_parser.txt Tue Oct 26 01:32:32 2021 +0200 @@ -39,3 +39,21 @@ Separated by break || Some text }}} + +{{{#!table + * A + * B +|| + * C + * D +== + + * E + * F + +|| + + * G + * H + +}}}