mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Handle <img> in <a href> tags
This commit is contained in:
parent
a29bf8eea0
commit
b2a301912f
@ -502,6 +502,14 @@ class HTMLConverter(object):
|
|||||||
for link in self.links:
|
for link in self.links:
|
||||||
para, tag = link.para, link.tag
|
para, tag = link.para, link.tag
|
||||||
text = self.get_text(tag)
|
text = self.get_text(tag)
|
||||||
|
if not text:
|
||||||
|
text = 'Link'
|
||||||
|
img = tag.find('img')
|
||||||
|
if img:
|
||||||
|
try:
|
||||||
|
text = img['alt']
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
if self.hide_broken_links:
|
if self.hide_broken_links:
|
||||||
para.contents = []
|
para.contents = []
|
||||||
para.append(_Span(text=text))
|
para.append(_Span(text=text))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user