DOCX Input: Fix framed lists being rendered with the frame inside the bullets instead of outside it. Fixes #1709569 [Converting from DOCX - problem with framed paragraphs and lists](https://bugs.launchpad.net/calibre/+bug/1709569)

This commit is contained in:
Kovid Goyal 2017-08-10 10:54:09 +05:30
parent 6f0c724dad
commit e9f82abf39
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -724,8 +724,14 @@ class Convert(object):
for border_style, blocks in self.block_runs:
paras = tuple(rmap[p] for p in blocks)
parent = paras[0].getparent()
idx = parent.index(paras[0])
frame = DIV(*paras)
if parent.tag in ('ul', 'ol'):
ul = parent
parent = ul.getparent()
idx = parent.index(ul)
frame = DIV(ul)
else:
idx = parent.index(paras[0])
frame = DIV(*paras)
parent.insert(idx, frame)
self.framed_map[frame] = css = border_style.css
self.styles.register(css, 'frame')