slowniczek in pdf
[librarian.git] / librarian / xmlutils.py
index 97a3039..9e921a2 100644 (file)
@@ -26,7 +26,10 @@ class Xmill(object):
             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."""
@@ -39,7 +42,7 @@ class Xmill(object):
         """
         # 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):