mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow <p> to be embedded in <blockquote>
This commit is contained in:
parent
48c39f6144
commit
ae0b5d3168
@ -158,6 +158,7 @@ class HTMLConverter(object):
|
|||||||
self.memory = [] #: Used to ensure that duplicate CSS unhandled erros are not reported
|
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.tops = {} #: element representing the top of each HTML file in the LRF file
|
||||||
self.previous_text = '' #: Used to figure out when to lstrip
|
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
|
# Styles
|
||||||
self.blockquote_style = book.create_block_style(sidemargin=60,
|
self.blockquote_style = book.create_block_style(sidemargin=60,
|
||||||
topskip=20, footskip=20)
|
topskip=20, footskip=20)
|
||||||
@ -1054,7 +1055,8 @@ class HTMLConverter(object):
|
|||||||
ts.attrs.update(text_properties)
|
ts.attrs.update(text_properties)
|
||||||
ts.attrs['align'] = align
|
ts.attrs['align'] = align
|
||||||
bs = self.current_block.blockStyle.copy()
|
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)
|
self.current_block.append_to(self.current_page)
|
||||||
try:
|
try:
|
||||||
index = self.text_styles.index(ts)
|
index = self.text_styles.index(ts)
|
||||||
@ -1299,7 +1301,9 @@ class HTMLConverter(object):
|
|||||||
self.current_block = self.book.create_text_block(
|
self.current_block = self.book.create_text_block(
|
||||||
blockStyle=bs, textStyle=ts)
|
blockStyle=bs, textStyle=ts)
|
||||||
self.previous_text = '\n'
|
self.previous_text = '\n'
|
||||||
|
self.preserve_block_style = True
|
||||||
self.process_children(tag, tag_css, tag_pseudo_css)
|
self.process_children(tag, tag_css, tag_pseudo_css)
|
||||||
|
self.preserve_block_style = False
|
||||||
self.current_para.append_to(self.current_block)
|
self.current_para.append_to(self.current_block)
|
||||||
self.current_block.append_to(self.current_page)
|
self.current_block.append_to(self.current_page)
|
||||||
self.current_para = Paragraph()
|
self.current_para = Paragraph()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user