if text is None:
return None
text = flt(text)
- return text
+ # TODO: just work on the tree and let lxml handle escaping.
+ e = etree.Element("x")
+ e.text = text
+ return etree.tostring(e, encoding=unicode)[3:-4]
def generate(self, document):
"""Generate text from node using handlers defined in class."""
"""
# Here we can see how a decision not to return the modified map
# leads to a need for a hack.
- return reduce(lambda a, b: a.update(b) or a, self._options, defaultdict(lambda: False))
+ return reduce(lambda a, b: a.update(b) or a, self._options, defaultdict(lambda: None))
@options.setter
def options(self, opts):