File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change
1
+
2
+ .. image :: https://scan.coverity.com/projects/621/badge.svg
3
+ :target: https://scan.coverity.com/projects/621
4
+ :alt: Coverity Scan Build Status
5
+
6
+ .. image :: https://scan.coverity.com/projects/621/badge.svg
7
+ :alt: Coverity Scan Build Status
Original file line number Diff line number Diff line change @@ -93,21 +93,22 @@ class GitHubHTMLTranslator(HTMLTranslator):
93
93
def depart_image (self , node ):
94
94
uri = node ['uri' ]
95
95
ext = os .path .splitext (uri )[1 ].lower ()
96
- # we need to swap RST's obj with img tags
96
+ # we need to swap RST's use of `object` with ` img` tags
97
97
# see http://git.io/5me3dA
98
98
if ext == ".svg" :
99
99
# preserve essential attributes
100
100
atts = {}
101
- atts ['src' ] = node ['uri' ]
102
- atts ['alt' ] = node .get ('alt' , uri )
103
- if 'width' in node :
104
- atts ['width' ] = node ['width' ]
105
- if 'height' in node :
106
- atts ['height' ] = node ['height' ]
107
-
108
- # toss off obj tag
101
+ for attribute , value in node .attributes .items ():
102
+ # we have no time for empty values
103
+ if value :
104
+ if attribute == "uri" :
105
+ atts ['src' ] = value
106
+ else :
107
+ atts [attribute ] = value
108
+
109
+ # toss off `object` tag
109
110
self .body .pop ()
110
- # add on img with attributes
111
+ # add on ` img` with attributes
111
112
self .body .append (self .starttag (node , 'img' , ** atts ))
112
113
self .body .append (self .context .pop ())
113
114
You can’t perform that action at this time.
0 commit comments