mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-28 19:13:07 +02:00
RTF Output: Fix bug that broke conversion to RTF when the input document contains <img> tags with no src attribute.
This commit is contained in:
parent
68216a0f7f
commit
402d28a8f0
1 changed files with 9 additions and 7 deletions
|
|
@ -234,13 +234,15 @@ def dump_text(self, elem, stylizer, tag_stack=[]):
|
|||
# Process tags that need special processing and that do not have inner
|
||||
# text. Usually these require an argument
|
||||
if tag == 'img':
|
||||
src = os.path.basename(elem.get('src'))
|
||||
block_start = ''
|
||||
block_end = ''
|
||||
if 'block' not in tag_stack:
|
||||
block_start = '{\\par\\pard\\hyphpar '
|
||||
block_end = '}'
|
||||
text += '%s SPECIAL_IMAGE-%s-REPLACE_ME %s' % (block_start, src, block_end)
|
||||
src = elem.get('src')
|
||||
if src:
|
||||
src = os.path.basename(elem.get('src'))
|
||||
block_start = ''
|
||||
block_end = ''
|
||||
if 'block' not in tag_stack:
|
||||
block_start = '{\\par\\pard\\hyphpar '
|
||||
block_end = '}'
|
||||
text += '%s SPECIAL_IMAGE-%s-REPLACE_ME %s' % (block_start, src, block_end)
|
||||
|
||||
single_tag = SINGLE_TAGS.get(tag, None)
|
||||
if single_tag:
|
||||
|
|
|
|||
Loading…
Reference in a new issue