1.1 --- a/moinformat/output/common.py Mon Aug 06 00:10:09 2018 +0200
1.2 +++ b/moinformat/output/common.py Mon Aug 06 00:11:08 2018 +0200
1.3 @@ -31,8 +31,8 @@
1.4
1.5 "Initialise the output context with the optional 'parameters'."
1.6
1.7 - self.parameters = parameters
1.8 - self.encoding = parameters and parameters.get("encoding") or self.default_encoding
1.9 + self.parameters = parameters or {}
1.10 + self.encoding = self.parameters.get("encoding") or self.default_encoding
1.11 self.reset()
1.12
1.13 def reset(self):
1.14 @@ -53,6 +53,14 @@
1.15
1.16 self.output.append(self.encode(text))
1.17
1.18 + # Page characteristics.
1.19 +
1.20 + def parent(self, pagename):
1.21 +
1.22 + "Return the parent of 'pagename'."
1.23 +
1.24 + return "/" in pagename and pagename.rsplit("/", 1)[0] or None
1.25 +
1.26 # Serialisation methods.
1.27
1.28 def to_string(self):