From: Jan Szejko Date: Wed, 6 Jun 2018 14:09:49 +0000 (+0200) Subject: fix epub for weird corner case X-Git-Tag: 1.7~22 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/c220cf2765a0c7bef4094b2628a20f45d99f6068?hp=1df9b49c8a7378b1fb300c413c2c438b1d41b969 fix epub for weird corner case --- diff --git a/librarian/epub.py b/librarian/epub.py index 397dc51..8d4e73f 100644 --- a/librarian/epub.py +++ b/librarian/epub.py @@ -201,10 +201,10 @@ class Stanza(object): if not text: return for i, verse_text in enumerate(re.split(r"/\s*\n", text)): - if not verse_text.strip(): - continue 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