Skip to content
This repository has been archived by the owner on Mar 15, 2020. It is now read-only.

Commit

Permalink
A bit more pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
rupor-github committed May 13, 2017
1 parent bf9f50a commit 9500615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions modules/fb2html.py
Expand Up @@ -821,16 +821,20 @@ def parse_format(self, elem, tag=None, css=None, href=None):
if self.current_file in self.pages_list and self.page_length + len(elem.text) >= self.characters_per_page:
page = self.pages_list[self.current_file]
text = ''

for w in elem.text.split(' '):
text = w if text == '' else ' '.join([text, w])
if not text:
text = ' ' if not w else w
else:
text = ' '.join([text, w])
if self.page_length + len(text) >= self.characters_per_page:
hs = self.insert_hyphenation(text)
if dodropcaps > 0:
self.buff.append('<span class="dropcaps">{}</span>{}'.format(hs[0:dodropcaps], save_html(hs[dodropcaps:])))
dodropcaps = 0
else:
self.buff.append(save_html(hs))
self.buff.append('<a class="pagemarker" id="page_{0:d}"/>'.format(page))
self.buff.append('<a class="pagemarker" id="page_{0:d}"/> '.format(page))
page += 1
text = ''
self.page_length = 0
Expand Down
2 changes: 1 addition & 1 deletion version.py
Expand Up @@ -4,4 +4,4 @@

WINDOWS = platform.system().lower() == "windows"

VERSION = u'3.6.20'
VERSION = u'3.6.21'

0 comments on commit 9500615

Please sign in to comment.