mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
also check for tables inside paragraphs
This commit is contained in:
parent
170a6fd64f
commit
a9b4c3f4db
@ -124,8 +124,9 @@ class FB2Input(InputFormatPlugin):
|
||||
img.set('src', self.binary_map.get(src, src))
|
||||
|
||||
# make paragraphs <p> tags
|
||||
has_block_elements = etree.XPath('descendant::*[name()="div" or name()="table"]')
|
||||
for divp in result.xpath('//body/div[@class="paragraph"]'):
|
||||
if not divp.xpath('descendant::div'):
|
||||
if not has_block_elements(divp):
|
||||
divp.tag = 'p'
|
||||
|
||||
index = transform.tostring(result)
|
||||
|
Loading…
x
Reference in New Issue
Block a user