1.1 --- a/moinformat/tree.py Fri Jul 13 16:59:27 2018 +0200
1.2 +++ b/moinformat/tree.py Fri Jul 13 18:53:55 2018 +0200
1.3 @@ -3,7 +3,7 @@
1.4 """
1.5 Moin wiki format document tree nodes.
1.6
1.7 -Copyright (C) 2017 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2017, 2018 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 @@ -19,8 +19,6 @@
1.13 this program. If not, see <http://www.gnu.org/licenses/>.
1.14 """
1.15
1.16 -from moinformat.serialisers import serialisers
1.17 -
1.18 class Container:
1.19
1.20 "A container of document nodes."
1.21 @@ -132,10 +130,13 @@
1.22 def to_string(self, out):
1.23 out.start_region(self.level, self.indent, self.type)
1.24
1.25 - # Obtain a serialiser for the region and serialise.
1.26 + # Obtain a serialiser for the region, if appropriate.
1.27
1.28 - region_out = serialisers.get(self.type)
1.29 - region_out = region_out and region_out(out.out) or out
1.30 + serialiser = out.formats and out.formats.get(self.type)
1.31 + region_out = serialiser and serialiser(out.out) or out
1.32 +
1.33 + # Serialise the region.
1.34 +
1.35 self._to_string(region_out)
1.36
1.37 out.end_region(self.level, self.indent, self.type)