fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Workaround for nasty literal HTML inserting issue.
[librarian.git]
/
librarian
/
xmlutils.py
diff --git
a/librarian/xmlutils.py
b/librarian/xmlutils.py
index
340ee83
..
8890f4e
100644
(file)
--- a/
librarian/xmlutils.py
+++ b/
librarian/xmlutils.py
@@
-22,11
+22,15
@@
class Xmill(object):
self.text_filters.append(fun)
def filter_text(self, text):
self.text_filters.append(fun)
def filter_text(self, text):
+ # TODO: just work on the tree and let lxml handle escaping.
+ e = etree.Element("x")
+ e.text = text
+ # This whole mixing text with ML is so wrong.
+ output = etree.tostring(e, encoding=unicode)[3:-4]
for flt in self.text_filters:
for flt in self.text_filters:
- if text is None:
- return None
- text = flt(text)
- return text
+ output = flt(output)
+ return output
+
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."""