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

Allow "blob" links for images #16

Open
julianstirling opened this issue Feb 27, 2020 · 2 comments
Open

Allow "blob" links for images #16

julianstirling opened this issue Feb 27, 2020 · 2 comments

Comments

@julianstirling
Copy link
Member

It seems that a few manifests are failing because the link is to the github or gitlab blob not to the raw. While it is technically not our problem, we could simply fix this with 1 regex

^(https:\/\/git(?:hub|lab).com\/.*\/)blob(\/.*)$

And then if it matches then instead have the link be:

\1raw\2

where \1 and \2 are the regex groups 1 and 2. I would put in a merge request but I don't properly understand javascript.

@kasbah
Copy link
Member

kasbah commented Feb 27, 2020

We could do it, but then we make it our responsibility. We do it for Kitspace readmes but it's a pain to maintain (though it's more complicated because of the way relative links from readmes work). I am really not sure we should be encoding platform quirks into our implementation of a standard. What it means is we are making things more complicated for everyone that wants to crawl manifests.

Putting my QA engineer hat on your regex will probably fail if someone decides to calls their project blob or makes a branch called blob.

“A QA engineer walks into a bar. Orders a beer. Orders 0 beers. Orders 999999999 beers. Orders a lizard. Orders -1 beers. Orders a sfdeljknesv.”

@kasbah
Copy link
Member

kasbah commented Feb 29, 2020

Though your regex is actually a bit better than what we had on Kitspace before, so I stole it.

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

No branches or pull requests

2 participants