X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/f33381c4b0468544123ff05295033da7cc4bf61f..f09227d78c24b17a0e86b1d192ba8c26d9e06aef:/librarian/epub.py?ds=inline diff --git a/librarian/epub.py b/librarian/epub.py index 3bdd1cd..a5607f7 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -276,6 +276,8 @@ def transform(provider, slug=None, file_path=None, output_file=None, output_dir= def transform_file(input_xml, chunk_counter=1, first=True): """ processes one input file and proceeds to its children """ + replace_characters(input_xml.getroot()) + children = [child.text for child in input_xml.findall('.//'+DCNS('relation.hasPart'))] # every input file will have a TOC entry, @@ -308,8 +310,6 @@ def transform(provider, slug=None, file_path=None, output_file=None, output_dir= main_text = None if main_text is not None: - replace_characters(main_text) - for chunk_xml in chop(main_text): chunk_html, chunk_toc, chunk_chars = transform_chunk(chunk_xml, chunk_counter, annotations) toc.extend(chunk_toc)