mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -234,13 +234,15 @@ class RTFMLizer(object):
|
|||||||
# Process tags that need special processing and that do not have inner
|
# Process tags that need special processing and that do not have inner
|
||||||
# text. Usually these require an argument
|
# text. Usually these require an argument
|
||||||
if tag == 'img':
|
if tag == 'img':
|
||||||
src = os.path.basename(elem.get('src'))
|
src = elem.get('src')
|
||||||
block_start = ''
|
if src:
|
||||||
block_end = ''
|
src = os.path.basename(elem.get('src'))
|
||||||
if 'block' not in tag_stack:
|
block_start = ''
|
||||||
block_start = '{\\par\\pard\\hyphpar '
|
block_end = ''
|
||||||
block_end = '}'
|
if 'block' not in tag_stack:
|
||||||
text += '%s SPECIAL_IMAGE-%s-REPLACE_ME %s' % (block_start, src, block_end)
|
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)
|
single_tag = SINGLE_TAGS.get(tag, None)
|
||||||
if single_tag:
|
if single_tag:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user