alexandrevicenzi / gistfy

Code once, share everywhere.
MIT License
65 stars 22 forks source link

Invalid Url for bika.lims git repo #27

Closed trendsetter37 closed 8 years ago

trendsetter37 commented 8 years ago

Using Gistfy I am getting a Invalid Url error for a valid repository file.

Reproduce using this file.

alexandrevicenzi commented 8 years ago

I will take a look. I can reproduce this here.

trendsetter37 commented 8 years ago

I can take a closer look later tonight as well but could it be somewhere in here?

L#263 gistfy.js

if (host === 'github') {
    htmlUrl =  util.format('https://github.com/%s/%s/blob/%s/%s', user, repo, branch, path);
    rawUrl =  util.format('https://raw.githubusercontent.com/%s/%s/%s/%s', user, repo, branch, path);
    repoUrl = util.format('https://github.com/%s/%s', user, repo);
alexandrevicenzi commented 8 years ago

@trendsetter37 it's fixed.

Thanks.

trendsetter37 commented 8 years ago

More specifically I think it has to do with any url that has a . in the url other than at the end delimiting the file type.

Invalid url (according to Gistfy but valid repo files)


https://github.com/trendsetter37/bika.lims/blob/master/setup.py https://github.com/bikalabs/bika.lims/blob/master/bika/lims/tests/test_ARImport.py

Valid url (minus extra .)


https://github.com/cambecc/earth/blob/master/public/test/micro-test.html

alexandrevicenzi commented 8 years ago

Yes, there's a regex to validate urls, and it wasn't accepting special chars in repository name.

trendsetter37 commented 8 years ago

Thanks @alexandrevicenzi