Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Link gist repos as well as github urls, fixes #129 #257

Closed
wants to merge 1 commit into from

2 participants

@isaacs
Owner

Doesn't quite work. For the specified case, in #129, it links to https://github.com/gist.github.com/3135914, which is clearly mistaken. For github repo urls, it links to https://github.com/github.com/isaacs/npm which is also wrong.

@isaacs isaacs closed this
@robertkowalski

are you sure?

var regex = /^(?:https?:\/\/|git(?::\/\/|@))(gist.github.com|github.com)[:\/](.*?)(?:.git)?$/
var gh = "git@gist.github.com:3135914.git".match(regex)

console.log(gh)

results for me in

[ 'git@gist.github.com:3135914.git',
  'gist.github.com',
  '3135914',
  index: 0,
  input: 'git@gist.github.com:3135914.git' ]
@isaacs
Owner

Can you rebase this onto the latest master? Indeed, when I check out just this patch, it works, but I must have broken it on the merge or something.

@isaacs isaacs reopened this
@robertkowalski

rebased.

@isaacs
Owner

kewl, thanks! Landed on master, pushed to npmjs.org

@isaacs isaacs closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 18, 2013
  1. @robertkowalski
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 templates/package-page.ejs
View
4 templates/package-page.ejs
@@ -78,9 +78,9 @@
<% if (package.repository && package.repository !== 'undefined') {
var gh = package.repository.url &&
package.repository.url.match(
- /^(?:https?:\/\/|git(?::\/\/|@))github.com[:\/](.*?)(?:.git)?$/)
+ /^(?:https?:\/\/|git(?::\/\/|@))(gist.github.com|github.com)[:\/](.*?)(?:.git)?$/)
if (gh) {
- gh = 'https://github.com/' + gh[1]
+ gh = 'https://' + gh[1] + '/' + gh[2]
}
%>
<tr>
Something went wrong with that request. Please try again.