Compare commits

...

2 Commits

Author SHA1 Message Date
Fierelier f26b863155 Shorten image-prefix, move it outside a-tag so linked images can be clicked 2021-03-19 03:29:11 +01:00
Fierelier 5ba20c0244 Handling empty properties 2021-03-19 03:24:36 +01:00
1 changed files with 5 additions and 2 deletions

View File

@ -36,14 +36,17 @@ class browserDoc(QTextBrowser):
if attr[0] == "src":
url = attr[1]
if not altText: altText = url.rsplit("/")[-1]
self.output += '<a href="' +html.escape(url)+ '">image: ' +html.escape(altText)+ '</a>'
self.output += 'img:<a href="' +html.escape(url)+ '">' +html.escape(altText)+ '</a>'
return
return
self.output += "<" +tag
for attr in attrs:
self.output += ' ' +html.escape(attr[0])+ '="' +html.escape(attr[1])+ '"'
if attr[1] != None:
self.output += ' ' +html.escape(attr[0])+ '="' +html.escape(attr[1])+ '"'
else:
self.output += ' ' +html.escape(attr[0])
self.output += ">"
def handle_endtag(self,tag):