1.1 --- a/moinformat/tree/moin.py Wed Oct 06 00:16:28 2021 +0200
1.2 +++ b/moinformat/tree/moin.py Sat Oct 09 00:34:01 2021 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Moin wiki format document tree nodes.
1.6
1.7 -Copyright (C) 2017, 2018, 2019, 2020 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2017, 2018, 2019, 2020, 2021 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 @@ -508,19 +508,23 @@
1.13
1.14 "A table cell."
1.15
1.16 - def __init__(self, nodes, attrs=None):
1.17 + def __init__(self, nodes, attrs=None, leading="", padding=""):
1.18 Container.__init__(self, nodes)
1.19 self.attrs = attrs
1.20 + self.leading = leading
1.21 + self.padding = padding
1.22
1.23 def __repr__(self):
1.24 - return "TableCell(%r, %r)" % (self.nodes, self.attrs)
1.25 + return "TableCell(%r, %r, %r, %r)" % (self.nodes, self.attrs,
1.26 + self.leading, self.padding)
1.27
1.28 def prettyprint(self, indent=""):
1.29 - l = ["%sTableCell:" % indent]
1.30 + l = ["%sTableCell: leading=%r padding=%r" % (indent, self.leading,
1.31 + self.padding)]
1.32 return self._prettyprint(l, indent)
1.33
1.34 def to_string(self, out):
1.35 - out.start_table_cell(self.attrs)
1.36 + out.start_table_cell(self.attrs, self.leading, self.padding)
1.37 self._to_string(out)
1.38 out.end_table_cell()
1.39
1.40 @@ -528,19 +532,23 @@
1.41
1.42 "A table row."
1.43
1.44 - def __init__(self, nodes, trailing=""):
1.45 + def __init__(self, nodes, trailing="", leading="", padding=""):
1.46 Container.__init__(self, nodes)
1.47 self.trailing = trailing
1.48 + self.leading = leading
1.49 + self.padding = padding
1.50
1.51 def __repr__(self):
1.52 - return "TableRow(%r, %r)" % (self.nodes, self.trailing)
1.53 + return "TableRow(%r, %r, %r, %r)" % (self.nodes, self.trailing,
1.54 + self.leading, self.padding)
1.55
1.56 def prettyprint(self, indent=""):
1.57 - l = ["%sTableRow: trailing=%r" % (indent, self.trailing)]
1.58 + l = ["%sTableRow: trailing=%r leading=%r padding=%r" % (
1.59 + indent, self.trailing, self.leading, self.padding)]
1.60 return self._prettyprint(l, indent)
1.61
1.62 def to_string(self, out):
1.63 - out.start_table_row()
1.64 + out.start_table_row(self.leading, self.padding)
1.65 self._to_string(out)
1.66 out.end_table_row(self.trailing)
1.67