mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 10:13:42 +02:00
Allow <p> to be embedded in <blockquote>
This commit is contained in:
parent
48c39f6144
commit
ae0b5d3168
1 changed files with 5 additions and 1 deletions
|
|
@ -158,6 +158,7 @@ def __init__(self, book, fonts, options, logger, path):
|
|||
self.memory = [] #: Used to ensure that duplicate CSS unhandled erros are not reported
|
||||
self.tops = {} #: element representing the top of each HTML file in the LRF file
|
||||
self.previous_text = '' #: Used to figure out when to lstrip
|
||||
self.preserve_block_style = False #: Used so that <p> tags in <blockquote> elements are handles properly
|
||||
# Styles
|
||||
self.blockquote_style = book.create_block_style(sidemargin=60,
|
||||
topskip=20, footskip=20)
|
||||
|
|
@ -1054,7 +1055,8 @@ def process_block(self, tag, tag_css):
|
|||
ts.attrs.update(text_properties)
|
||||
ts.attrs['align'] = align
|
||||
bs = self.current_block.blockStyle.copy()
|
||||
bs.attrs.update(block_properties)
|
||||
if not self.preserve_block_style:
|
||||
bs.attrs.update(block_properties)
|
||||
self.current_block.append_to(self.current_page)
|
||||
try:
|
||||
index = self.text_styles.index(ts)
|
||||
|
|
@ -1299,7 +1301,9 @@ def update_css(ncss, ocss):
|
|||
self.current_block = self.book.create_text_block(
|
||||
blockStyle=bs, textStyle=ts)
|
||||
self.previous_text = '\n'
|
||||
self.preserve_block_style = True
|
||||
self.process_children(tag, tag_css, tag_pseudo_css)
|
||||
self.preserve_block_style = False
|
||||
self.current_para.append_to(self.current_block)
|
||||
self.current_block.append_to(self.current_page)
|
||||
self.current_para = Paragraph()
|
||||
|
|
|
|||
Loading…
Reference in a new issue