mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:23:10 +02:00
Make page break insertion a little more sensitive.
This commit is contained in:
parent
7ee1d99e5b
commit
3dc1510809
1 changed files with 2 additions and 1 deletions
|
|
@ -1010,7 +1010,8 @@ def process_page_breaks(self, tag, tagname, tag_css):
|
|||
self.end_page()
|
||||
self.page_break_found = True
|
||||
if not self.page_break_found and self.page_break.match(tagname):
|
||||
if len(self.current_page.contents) > 3:
|
||||
num = len([1 for i in self.current_block.contents if isinstance(i, Paragraph)])
|
||||
if len(self.current_page.contents) > 3 or num > 3:
|
||||
self.end_page()
|
||||
self.logger.debug('Forcing page break at %s', tagname)
|
||||
return end_page
|
||||
|
|
|
|||
Loading…
Reference in a new issue