From: Radek Czajka Date: Mon, 21 Feb 2011 12:08:51 +0000 (+0100) Subject: bugfix for with tail X-Git-Tag: 1.7~207 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/e2bc69b731434e6929686637ba4cf296632138e2?ds=inline bugfix for with tail --- diff --git a/librarian/epub.py b/librarian/epub.py index f2987b5..a615b7e 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -84,13 +84,10 @@ def replace_characters(node): .replace(",,", u"\u201E")\ .replace('"', u"\u201D")\ .replace("'", u"\u2019") - if node.tag == 'extra': - node.clear() - else: - node.text = replace_chars(node.text) - node.tail = replace_chars(node.tail) - for child in node: - replace_characters(child) + node.text = replace_chars(node.text) + node.tail = replace_chars(node.tail) + for child in node: + replace_characters(child) def find_annotations(annotations, source, part_no): @@ -106,7 +103,7 @@ def find_annotations(annotations, source, part_no): child.clear() child.tail = tail child.text = number - if child.tag not in ('extra',): + if child.tag not in ('extra', 'uwaga'): find_annotations(annotations, child, part_no)