X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/c5a372b4595e9ee280ca38b5f361a3a22141fb38..0c0fdd2db2c1277108b03a1acf88ad63d140451a:/librarian/epub.py?ds=sidebyside diff --git a/librarian/epub.py b/librarian/epub.py index 3e9056c..8d4e73f 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -19,7 +19,7 @@ from tempfile import mkdtemp, NamedTemporaryFile from shutil import rmtree from librarian import RDFNS, WLNS, NCXNS, OPFNS, XHTMLNS, DCNS, OutputFile -from librarian.cover import DefaultEbookCover +from librarian.cover import make_cover from librarian import functions, get_resource @@ -203,6 +203,8 @@ class Stanza(object): for i, verse_text in enumerate(re.split(r"/\s*\n", text)): if i: self.open_normal_verse() + if not verse_text.strip(): + continue verse = self.get_open_verse() if len(verse): verse[-1].tail = (verse[-1].tail or "") + verse_text @@ -563,7 +565,7 @@ def transform(wldoc, verbose=False, style=None, html_toc=False, if cover: if cover is True: - cover = DefaultEbookCover + cover = make_cover cover_file = StringIO() bound_cover = cover(document.book_info)