Shields: [Bug][reStructuredText] Badges displayed on GitHub as block elements

Created on 8 Feb 2018  Β·  2Comments  Β·  Source: badges/shields

1. Summary

If my badge from shields.io:

β€…β€…β€…β€…it displayed as block element on GitHub.

elif my badge from another service:

β€…β€…β€…β€…it displayed as inline element on GitHub.

I don't think, that badges displaying as block element β€” it expected behavior.

2. Demonstration

2.1. GitHub

See https://github.com/Kristinita/SashaShieldsIoDebugging repository:

GitHub

python, wheel and commitizen badges β€” from img.shields.io.

See source of my Readme.rst .

2.2. PyPI

In PyPI site all my badges β€” from shiels.io and another services β€” display as inline elements:

PyPI

3. Not helped

  1. I don't find in badge setting, that I can change inline and block displaying.
  2. I try plastic style instead of default flat β€” I get same behavior.

Thanks.

question

Most helpful comment

This appears to be a quirk of the way GitHub renders RST. I can't reproduce it in another RST Editor. As a workaround, if you set a link target on the badges, that will get them to render inline. I've forked your repo to demonstrate. See:

https://github.com/chris48s/SashaShieldsIoDebugging/blob/master/Readme.rst

https://github.com/chris48s/SashaShieldsIoDebugging/commit/27cd54957bdf219e0e5e4874eef46b41bb58de0e

I expect if you remove the link targets from the other badges you'll probably see the same behaviour but I have not tested it.

All 2 comments

This appears to be a quirk of the way GitHub renders RST. I can't reproduce it in another RST Editor. As a workaround, if you set a link target on the badges, that will get them to render inline. I've forked your repo to demonstrate. See:

https://github.com/chris48s/SashaShieldsIoDebugging/blob/master/Readme.rst

https://github.com/chris48s/SashaShieldsIoDebugging/commit/27cd54957bdf219e0e5e4874eef46b41bb58de0e

I expect if you remove the link targets from the other badges you'll probably see the same behaviour but I have not tested it.

Thanks! @chris48s, maybe you add in README, that target necessary for GitHub?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

salaros picture salaros  Β·  3Comments

lukeeey picture lukeeey  Β·  3Comments

calebcartwright picture calebcartwright  Β·  3Comments

techtonik picture techtonik  Β·  3Comments

kirankotari picture kirankotari  Β·  3Comments