##// END OF EJS Templates
markup-renderer: use safe fetching of attributes to prevent from errors on malformed html.
marcink -
r1840:05beb7b6 default
parent child Browse files
Show More
@@ -83,12 +83,12 b' def relative_links(html_source, server_p'
83 return html_source
83 return html_source
84
84
85 for el in doc.cssselect('img, video'):
85 for el in doc.cssselect('img, video'):
86 src = el.attrib['src']
86 src = el.attrib.get('src')
87 if src:
87 if src:
88 el.attrib['src'] = relative_path(src, server_path)
88 el.attrib['src'] = relative_path(src, server_path)
89
89
90 for el in doc.cssselect('a:not(.gfm)'):
90 for el in doc.cssselect('a:not(.gfm)'):
91 src = el.attrib['href']
91 src = el.attrib.get('href')
92 if src:
92 if src:
93 el.attrib['href'] = relative_path(src, server_path)
93 el.attrib['href'] = relative_path(src, server_path)
94
94
General Comments 0
You need to be logged in to leave comments. Login now