Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use names with underscores in them #29

Open
Griefed opened this issue Jan 24, 2021 · 2 comments
Open

How to use names with underscores in them #29

Griefed opened this issue Jan 24, 2021 · 2 comments

Comments

@Griefed
Copy link

Griefed commented Jan 24, 2021

Hello way2muchnoise,

I'm trying to figure out how I can create a total downloads badge for a user with an underscore in their name. Example: Corgi_Taco.
Was wondering whether there's a way to escape said underscore somehow.

Cheers,
Griefed

@cech12
Copy link

cech12 commented May 12, 2021

Hey,

I tried to escape the underscore like described here: https://stackoverflow.com/questions/2222519/url-encoding-with-underscores-in-a-directory-name/2222555

This leads to a url like: https://cf.way2muchnoise.eu/author/Corgi%255FTaco.svg
But this does not work. I think this line is the problem:

https://github.com/way2muchnoise/CurseForgeBadge/blob/84e5a5e2d9475a95986f764adb792968f10bd631/CFReader.py#L45

The F of %255F is lowered down and this leads to a failed underscore escaping. I think, this line is unnecessary and maybe when it is removed, it could work. :)

@BitBlitObviMormon
Copy link

BitBlitObviMormon commented Nov 16, 2022

Couldn't we simply replace underscores with tildes in the syntax (ie. Corgi~Taco)? I'm pretty sure ~ characters are illegal for usernames but legal for urls. It feels kind of backwards, but it should go around the issue of having to redesign the app to allow for escape characters.

Another perhaps better option would be to move all of the style syntax to get parameters like https://cf.way2muchnoise.eu/author/full_way2muchnoise_downloads.svg => https://cf.way2muchnoise.eu/author/way2muchnoise.svg?style=full&suffix=downloads

That, of course, would break all backwards compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants