mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #586
This commit is contained in:
parent
7ddfcd5711
commit
34ddfb4135
@ -653,10 +653,12 @@ class HTMLConverter(object):
|
|||||||
End the current page, ensuring that any further content is displayed
|
End the current page, ensuring that any further content is displayed
|
||||||
on a new page.
|
on a new page.
|
||||||
"""
|
"""
|
||||||
self.current_para.append_to(self.current_block)
|
if self.current_para.has_text():
|
||||||
self.current_para = Paragraph()
|
self.current_para.append_to(self.current_block)
|
||||||
self.current_block.append_to(self.current_page)
|
self.current_para = Paragraph()
|
||||||
self.current_block = self.book.create_text_block()
|
if self.current_block.has_text() or self.current_block.must_append:
|
||||||
|
self.current_block.append_to(self.current_page)
|
||||||
|
self.current_block = self.book.create_text_block()
|
||||||
if self.current_page.has_text():
|
if self.current_page.has_text():
|
||||||
self.book.append(self.current_page)
|
self.book.append(self.current_page)
|
||||||
self.current_page = self.book.create_page()
|
self.current_page = self.book.create_page()
|
||||||
@ -1601,7 +1603,7 @@ class HTMLConverter(object):
|
|||||||
if not self.disable_chapter_detection and tagname.startswith('h'):
|
if not self.disable_chapter_detection and tagname.startswith('h'):
|
||||||
if self.chapter_regex.search(src):
|
if self.chapter_regex.search(src):
|
||||||
self.logger.debug('Detected chapter %s', src)
|
self.logger.debug('Detected chapter %s', src)
|
||||||
self.end_page()
|
self.end_page()
|
||||||
self.page_break_found = True
|
self.page_break_found = True
|
||||||
|
|
||||||
if self.current_para.has_text():
|
if self.current_para.has_text():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user