diff --git a/src/calibre/ebooks/lrf/html/convert_from.py b/src/calibre/ebooks/lrf/html/convert_from.py index ab8550bd5e..e884ea7213 100644 --- a/src/calibre/ebooks/lrf/html/convert_from.py +++ b/src/calibre/ebooks/lrf/html/convert_from.py @@ -580,20 +580,20 @@ class HTMLConverter(object, LoggingInterface): if (css.has_key('display') and css['display'].lower() == 'none') or \ (css.has_key('visibility') and css['visibility'].lower() == 'hidden'): return '' - text = u'' + text, alt_text = u'', u'' for c in tag.contents: if limit != None and len(text) > limit: break if isinstance(c, HTMLConverter.IGNORED_TAGS): - return u'' + continue if isinstance(c, NavigableString): text += unicode(c) elif isinstance(c, Tag): if c.name.lower() == 'img' and c.has_key('alt'): - text += c['alt'] - return text + alt_text += c['alt'] + continue text += self.get_text(c) - return text + return text if text.strip() else alt_text def process_links(self): def add_toc_entry(text, target):