mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1730 (MOBI: missing page break)
This commit is contained in:
commit
05b7ccde9e
@ -77,6 +77,8 @@ class StyleToCSS:
|
||||
(FONS,u"border-left"): self.c_fo,
|
||||
(FONS,u"border-right"): self.c_fo,
|
||||
(FONS,u"border-top"): self.c_fo,
|
||||
(FONS,u"break-after"): self.c_break,
|
||||
(FONS,u"break-before"): self.c_break,
|
||||
(FONS,u"color"): self.c_fo,
|
||||
(FONS,u"font-family"): self.c_fo,
|
||||
(FONS,u"font-size"): self.c_fo,
|
||||
@ -139,6 +141,13 @@ class StyleToCSS:
|
||||
selector = rule[1]
|
||||
sdict[selector] = val
|
||||
|
||||
def c_break(self, ruleset, sdict, rule, val):
|
||||
property = 'page-' + rule[1]
|
||||
values = {'auto': 'auto', 'column': 'always', 'page': 'always',
|
||||
'even-page': 'left', 'odd-page': 'right',
|
||||
'inherit': 'inherit'}
|
||||
sdict[property] = values.get(val, 'auto')
|
||||
|
||||
def c_border_model(self, ruleset, sdict, rule, val):
|
||||
""" Convert to CSS2 border model """
|
||||
if val == 'collapsing':
|
||||
@ -1169,6 +1178,9 @@ class ODF2XHTML(handler.ContentHandler):
|
||||
if specialtag is None:
|
||||
specialtag = 'p'
|
||||
self.writedata()
|
||||
if not self.data:
|
||||
# Give substance to empty paragraphs, as rendered by OOo
|
||||
self.writeout(' ')
|
||||
self.closetag(specialtag)
|
||||
self.purgedata()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user