diff --git a/lib/github/commands/foo.rst b/lib/github/commands/foo.rst new file mode 100644 index 00000000..e0950998 --- /dev/null +++ b/lib/github/commands/foo.rst @@ -0,0 +1,7 @@ + +.. image:: https://scan.coverity.com/projects/621/badge.svg + :target: https://scan.coverity.com/projects/621 + :alt: Coverity Scan Build Status + +.. image:: https://scan.coverity.com/projects/621/badge.svg + :alt: Coverity Scan Build Status diff --git a/lib/github/commands/rest2html b/lib/github/commands/rest2html index eff55aa3..4df0ace6 100755 --- a/lib/github/commands/rest2html +++ b/lib/github/commands/rest2html @@ -28,6 +28,7 @@ __license__ = "CC0" __version__ = "0.1" import sys +import os # This fixes docutils failing with unicode parameters to CSV-Table. The -S # switch and the following 2 lines can be removed after upgrading to python 3. @@ -89,6 +90,28 @@ class GitHubHTMLTranslator(HTMLTranslator): def depart_table(self, node): self.body.append('\n') + def depart_image(self, node): + uri = node['uri'] + ext = os.path.splitext(uri)[1].lower() + # we need to swap RST's use of `object` with `img` tags + # see http://git.io/5me3dA + if ext == ".svg": + # preserve essential attributes + atts = {} + for attribute, value in node.attributes.items(): + # we have no time for empty values + if value: + if attribute == "uri": + atts['src'] = value + else: + atts[attribute] = value + + # toss off `object` tag + self.body.pop() + # add on `img` with attributes + self.body.append(self.starttag(node, 'img', **atts)) + self.body.append(self.context.pop()) + def main(): """ Parses the given ReST file or the redirected string input and returns the diff --git a/test/markups/README.rst b/test/markups/README.rst index e207534a..fd8ad722 100644 --- a/test/markups/README.rst +++ b/test/markups/README.rst @@ -33,3 +33,11 @@ API http://pullv.readthedocs.org/en/latest/api.html Issues https://github.com/tony/pullv/issues Source https://github.com/tony/pullv ============== ========================================================== + + +.. image:: https://scan.coverity.com/projects/621/badge.svg + :target: https://scan.coverity.com/projects/621 + :alt: Coverity Scan Build Status + +.. image:: https://scan.coverity.com/projects/621/badge.svg + :alt: Coverity Scan Build Status diff --git a/test/markups/README.rst.html b/test/markups/README.rst.html index 562a8e89..77990de5 100644 --- a/test/markups/README.rst.html +++ b/test/markups/README.rst.html @@ -49,3 +49,6 @@