1.1 --- a/moinformat/serialisers/moin/table.py Tue Jun 20 18:58:47 2023 +0200
1.2 +++ b/moinformat/serialisers/moin/table.py Wed Jun 28 16:12:26 2023 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Moin wiki table serialiser.
1.6
1.7 -Copyright (C) 2017, 2018, 2021 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2017, 2018, 2021, 2023 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -31,31 +31,35 @@
1.13 self.first_cell = False
1.14 self.first_row = False
1.15
1.16 - def start_table(self):
1.17 + def table(self, table):
1.18 self.first_row = True
1.19 + self.container(table)
1.20
1.21 - def start_table_cell(self, attrs, leading, padding):
1.22 + def table_cell(self, table_cell):
1.23 if not self.first_cell:
1.24 - self.out(leading)
1.25 + self.out(table_cell.leading)
1.26 self.out("||")
1.27 else:
1.28 self.first_cell = False
1.29 - self.out(padding)
1.30
1.31 - def start_table_row(self, leading, padding):
1.32 + self.out(table_cell.padding)
1.33 + self.container(table_cell)
1.34 +
1.35 + def table_row(self, table_row):
1.36 self.first_cell = True
1.37 +
1.38 if not self.first_row:
1.39 - self.out(leading)
1.40 + self.out(table_row.leading)
1.41 self.out("==")
1.42 - self.out(padding)
1.43 + self.out(table_row.padding)
1.44 else:
1.45 self.first_row = False
1.46
1.47 - def end_table_row(self, trailing):
1.48 - self.out(trailing)
1.49 + self.container(table_row)
1.50 + self.out(table_row.trailing)
1.51
1.52 - def continuation(self, text):
1.53 - self.out(text)
1.54 + def continuation(self, continuation):
1.55 + self.out(continuation.text)
1.56
1.57 serialiser = MoinTableSerialiser
1.58