File tree Expand file tree Collapse file tree 4 files changed +41
-0
lines changed Expand file tree Collapse file tree 4 files changed +41
-0
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 @@ -28,6 +28,7 @@ __license__ = "CC0"
28
28
__version__ = "0.1"
29
29
30
30
import sys
31
+ import os
31
32
32
33
# This fixes docutils failing with unicode parameters to CSV-Table. The -S
33
34
# switch and the following 2 lines can be removed after upgrading to python 3.
@@ -89,6 +90,28 @@ class GitHubHTMLTranslator(HTMLTranslator):
89
90
def depart_table (self , node ):
90
91
self .body .append ('</table>\n ' )
91
92
93
+ def depart_image (self , node ):
94
+ uri = node ['uri' ]
95
+ ext = os .path .splitext (uri )[1 ].lower ()
96
+ # we need to swap RST's use of `object` with `img` tags
97
+ # see http://git.io/5me3dA
98
+ if ext == ".svg" :
99
+ # preserve essential attributes
100
+ atts = {}
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
110
+ self .body .pop ()
111
+ # add on `img` with attributes
112
+ self .body .append (self .starttag (node , 'img' , ** atts ))
113
+ self .body .append (self .context .pop ())
114
+
92
115
def main ():
93
116
"""
94
117
Parses the given ReST file or the redirected string input and returns the
Original file line number Diff line number Diff line change @@ -33,3 +33,11 @@ API http://pullv.readthedocs.org/en/latest/api.html
33
33
Issues https://github.com/tony/pullv/issues
34
34
Source https://github.com/tony/pullv
35
35
============== ==========================================================
36
+
37
+
38
+ .. image :: https://scan.coverity.com/projects/621/badge.svg
39
+ :target: https://scan.coverity.com/projects/621
40
+ :alt: Coverity Scan Build Status
41
+
42
+ .. image :: https://scan.coverity.com/projects/621/badge.svg
43
+ :alt: Coverity Scan Build Status
Original file line number Diff line number Diff line change @@ -49,3 +49,6 @@ <h2>Header 2</h2>
49
49
</ tr >
50
50
</ tbody >
51
51
</ table >
52
+ < a class ="reference external image-reference " href ="https://scan.coverity.com/projects/621 "> < img alt ="Coverity Scan Build Status " src ="https://scan.coverity.com/projects/621/badge.svg ">
53
+ </ a >
54
+ < img alt ="Coverity Scan Build Status " src ="https://scan.coverity.com/projects/621/badge.svg ">
You can’t perform that action at this time.
0 commit comments