1.1 --- a/moinformat/parsers/table.py Mon Oct 25 00:55:44 2021 +0200
1.2 +++ b/moinformat/parsers/table.py Mon Oct 25 01:26:47 2021 +0200
1.3 @@ -58,6 +58,15 @@
1.4 while True:
1.5 self.parse_region_details(cell, self.region_pattern_names)
1.6
1.7 + # Suppress any initial paragraph break within a table cell. This is
1.8 + # caused by a blank line which might be employed for clarity.
1.9 +
1.10 + first = cell.node(0)
1.11 +
1.12 + if isinstance(first, Break):
1.13 + cell.remove(first)
1.14 + cell.padding += "\n"
1.15 +
1.16 # Detect the end of the table.
1.17
1.18 pattern = self.matching_pattern()
2.1 --- a/moinformat/serialisers/moin/table.py Mon Oct 25 00:55:44 2021 +0200
2.2 +++ b/moinformat/serialisers/moin/table.py Mon Oct 25 01:26:47 2021 +0200
2.3 @@ -38,9 +38,9 @@
2.4 if not self.first_cell:
2.5 self.out(leading)
2.6 self.out("||")
2.7 - self.out(padding)
2.8 else:
2.9 self.first_cell = False
2.10 + self.out(padding)
2.11
2.12 def start_table_row(self, leading, padding):
2.13 self.first_cell = True
3.1 --- a/tests/test_table_parser.tree Mon Oct 25 00:55:44 2021 +0200
3.2 +++ b/tests/test_table_parser.tree Mon Oct 25 01:26:47 2021 +0200
3.3 @@ -53,7 +53,6 @@
3.4 Table
3.5 TableRow
3.6 TableCell
3.7 - Break
3.8 Block
3.9 Text
3.10 TableCell