fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
slowniczek in pdf
[librarian.git]
/
librarian
/
xmlutils.py
diff --git
a/librarian/xmlutils.py
b/librarian/xmlutils.py
index
97a3039
..
9e921a2
100644
(file)
--- a/
librarian/xmlutils.py
+++ b/
librarian/xmlutils.py
@@
-26,7
+26,10
@@
class Xmill(object):
if text is None:
return None
text = flt(text)
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."""
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.
"""
# 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:
Fals
e))
+ return reduce(lambda a, b: a.update(b) or a, self._options, defaultdict(lambda:
Non
e))
@options.setter
def options(self, opts):
@options.setter
def options(self, opts):