profile_stack icon indicating copy to clipboard operation
profile_stack copied to clipboard

Encode all non-alphanumeric characters in technology names and logos

Open mosamadeeb opened this issue 1 year ago • 1 comments

Description

This fixes badges like this:

https://img.shields.io/static/v1?label=&message=C#&color=512BD4&logo=dotnet&logoColor=FFFFFF

by replacing the # in the &message query to %23

and now it looks like this:

Encoding all non-alphanumeric characters should be safe for just tech name and logo. From trial and error, I found out that only a small set of symbols (not included in the fragment encoding) cause this issue (including +, #, &, %).

Steps

  • [ ] My change requires a change to the documentation
  • [ ] I have updated the accessible documentation according
  • [x] There is no duplicate open or closed pull request for this fix/addition/issue resolution.

Original Issue

No issue has been opened yet.

mosamadeeb avatar Jun 17 '24 18:06 mosamadeeb

Test results

PR:

💻 Technology 🚀 Projects
Go Language fgh
Python profile_stack github/test

Expected:

💻 Technology 🚀 Projects
Go Language fgh
Python profile_stack github/test

Notice the unencoded percent in the last repository. This is probably due to the message being encoded after this manual addition of "%20(WIP)".

This is actually intended behavior, so either that literal should be changed to " (WIP)", or we can simplify the PR to just encode the extra characters that cause the bug, instead of all non-alphanumericals.

mosamadeeb avatar Jun 18 '24 02:06 mosamadeeb