mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1656 (html2epub losing tag class and style attributes)
This commit is contained in:
parent
16c495cd95
commit
4405063cd8
@ -50,6 +50,7 @@ class Splitter(LoggingInterface):
|
|||||||
self.split_size = 0
|
self.split_size = 0
|
||||||
|
|
||||||
# Split on page breaks
|
# Split on page breaks
|
||||||
|
self.splitting_on_page_breaks = True
|
||||||
if not opts.dont_split_on_page_breaks:
|
if not opts.dont_split_on_page_breaks:
|
||||||
self.log_info('\tSplitting on page breaks...')
|
self.log_info('\tSplitting on page breaks...')
|
||||||
if self.path in stylesheet_map:
|
if self.path in stylesheet_map:
|
||||||
@ -61,6 +62,7 @@ class Splitter(LoggingInterface):
|
|||||||
trees = list(self.trees)
|
trees = list(self.trees)
|
||||||
|
|
||||||
# Split any remaining over-sized trees
|
# Split any remaining over-sized trees
|
||||||
|
self.splitting_on_page_breaks = False
|
||||||
if self.opts.profile.flow_size < sys.maxint:
|
if self.opts.profile.flow_size < sys.maxint:
|
||||||
lt_found = False
|
lt_found = False
|
||||||
self.log_info('\tLooking for large trees...')
|
self.log_info('\tLooking for large trees...')
|
||||||
@ -203,7 +205,8 @@ class Splitter(LoggingInterface):
|
|||||||
elem.set('style', 'display:none')
|
elem.set('style', 'display:none')
|
||||||
|
|
||||||
def fix_split_point(sp):
|
def fix_split_point(sp):
|
||||||
sp.set('style', sp.get('style', '')+'page-break-before:avoid;page-break-after:avoid')
|
if not self.splitting_on_page_breaks:
|
||||||
|
sp.set('style', sp.get('style', '')+'page-break-before:avoid;page-break-after:avoid')
|
||||||
|
|
||||||
# Tree 1
|
# Tree 1
|
||||||
hit_split_point = False
|
hit_split_point = False
|
||||||
|
Loading…
x
Reference in New Issue
Block a user