Shields: problem with "for the badge" style and numeric values

Created on 19 Nov 2017  路  4Comments  路  Source: badges/shields

Is there a maximum amount of parameters that can be applied to a badge until it brakes?
Had some trouble with a badge once I appended 4 parameters. It started to show invalid then.

bug core

Most helpful comment

Nice catch!,
It will be because its trying to uppercase the numbers{{=it.escapeXml(it.text[1].toUpperCase())}}.
Will try create a fix for it soon.

All 4 comments

I haven't had any issues myself,
for example the dynamic json badge can have quite a few params:

https://img.shields.io/badge/dynamic/json.svg?uri=https://github.com/badges/shields/raw/master/package.json&query=$.version&prefix=v&suffix=%20dev&label=Shields&colorB=2980b9&colorA=2c3e50&style=flat-square
is using uri, query, prefix, suffix, label, colorB, colorA, style all without issue.

According to this stack overflow answer, It is different based on the browser you are using and is a limit on the total number of characters in the URI.

Do you have an example of the badge that broke?

Sure, it's this one @RedSparr0w:
https://img.shields.io/github/commits-since/Cockatrice/Cockatrice/latest.svg?label=changes&colorA=6d6d6d&colorB=f37f40&style=for-the-badge

The simple version without any parameters is working:

I have the same problem on chrome and firefox by the way.

Actually, I think it's a problem with the new style. Just adding ?style=for-the-badge to the plain version gives me this (style is applied, but value turns invalid):

Nice catch!,
It will be because its trying to uppercase the numbers{{=it.escapeXml(it.text[1].toUpperCase())}}.
Will try create a fix for it soon.

With the deploy from yesterday this problem still persists!
Edit: it looks like it was no full code deploy with all recent changes...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

salaros picture salaros  路  3Comments

rominf picture rominf  路  3Comments

kerolloz picture kerolloz  路  3Comments

stclairdaniel picture stclairdaniel  路  3Comments

niccokunzmann picture niccokunzmann  路  3Comments