mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DOCX Output: Fix comments/XML processing instructions in the middle of text causing text to be skipped. Fixes #1727599 [Private bug](https://bugs.launchpad.net/calibre/+bug/1727599)
This commit is contained in:
parent
6d95b25dbd
commit
43011b9a97
@ -522,8 +522,14 @@ class Convert(object):
|
||||
tag_style.set('border-%s-style' % edge, 'none')
|
||||
self.add_block_tag(tagname, html_tag, tag_style, stylizer, float_spec=float_spec)
|
||||
|
||||
for child in html_tag.iterchildren('*'):
|
||||
self.process_tag(child, stylizer, float_spec=float_spec)
|
||||
for child in html_tag.iterchildren():
|
||||
if isinstance(getattr(child, 'tag', None), basestring):
|
||||
self.process_tag(child, stylizer, float_spec=float_spec)
|
||||
else: # Comment/PI/etc.
|
||||
tail = getattr(child, 'tail', None)
|
||||
if tail:
|
||||
block = self.create_block_from_parent(html_tag, stylizer)
|
||||
block.add_text(tail, tag_style, is_parent_style=False, link=self.current_link, lang=self.current_lang)
|
||||
|
||||
is_block = html_tag in self.blocks.open_html_blocks
|
||||
self.blocks.finish_tag(html_tag)
|
||||
|
Loading…
x
Reference in New Issue
Block a user