forked from solderpunk/AV-98
Revert completely previous fix.
Instead, if we do not support an inline image format, we don’t display it at all instead of displaying a fake URL
This commit is contained in:
parent
979b80c5bd
commit
29c447cd8e
21
ansicat.py
21
ansicat.py
|
@ -1165,15 +1165,18 @@ class HtmlRenderer(AbstractRenderer):
|
|||
if not mode in self.images:
|
||||
self.images[mode] = []
|
||||
abs_url,data = looks_like_base64(src,self.url)
|
||||
links.append(abs_url+" "+text)
|
||||
self.images[mode].append(abs_url)
|
||||
link_id = " [%s]"%(len(links)+startlinks)
|
||||
r.add_block(ansi_img)
|
||||
r.open_theme("image_link")
|
||||
r.center_line()
|
||||
r.add_text(text + link_id)
|
||||
r.close_theme("image_link")
|
||||
r.newline()
|
||||
#if abs_url is None, it means we don’t support
|
||||
#the image (such as svg+xml). So we hide it.
|
||||
if abs_url:
|
||||
links.append(abs_url+" "+text)
|
||||
self.images[mode].append(abs_url)
|
||||
link_id = " [%s]"%(len(links)+startlinks)
|
||||
r.add_block(ansi_img)
|
||||
r.open_theme("image_link")
|
||||
r.center_line()
|
||||
r.add_text(text + link_id)
|
||||
r.close_theme("image_link")
|
||||
r.newline()
|
||||
elif element.name == "br":
|
||||
r.newline()
|
||||
elif element.name not in ["script","style","template"] and type(element) != Comment:
|
||||
|
|
|
@ -146,8 +146,7 @@ def looks_like_base64(src,baseurl):
|
|||
imgurl = urllib.parse.urljoin(baseurl, imgname)
|
||||
else:
|
||||
#We can’t handle other data:image such as svg for now
|
||||
#Url cannot be none so set to the base URL
|
||||
imgurl = urllib.parse.urljoin(baseurl,"offpunk_does_not_support_inline.svg")
|
||||
imgurl = None
|
||||
else:
|
||||
imgurl = urllib.parse.urljoin(baseurl, imgname)
|
||||
return imgurl,imgdata
|
||||
|
|
Loading…
Reference in New Issue