Skip to content

Commit

Permalink
do not prepend with http by default
Browse files Browse the repository at this point in the history
  • Loading branch information
jchopard committed Feb 12, 2018
1 parent 3cb1656 commit d7cb50a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/pkglts/option/doc/__init__.py
Expand Up @@ -15,10 +15,15 @@ def fmt_badge(badge, url, txt, fmt):
Returns:
(str)
"""
if not url.startswith("http"):
url = "https://%s" % url
if not badge.startswith("http"):
badge = "https://%s" % badge

if fmt == 'rst':
lines = [".. image:: https://%s" % badge,
lines = [".. image:: %s" % badge,
" :alt: %s" % txt,
" :target: https://%s" % url]
" :target: %s" % url]
return "\n" + "\n".join(lines)

if fmt == 'md':
Expand Down

0 comments on commit d7cb50a

Please sign in to comment.