Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit29adfe5

Browse files
committed
fix: backport regex fix from#76
PR-URL:#84Credit:@nlfClose:#84Reviewed-by:@wraithgar
1 parentafeaefd commit29adfe5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function fromUrl (giturl, opts) {
4141
isGitHubShorthand(giturl) ?'github:'+giturl :giturl
4242
)
4343
varparsed=parseGitUrl(url)
44-
varshortcutMatch=url.match(newRegExp('^([^:]+):(?:(?:[^@:]+(?:[^@]+)?@)?([^/]*))[/](.+?)(?:[.]git)?($|#)'))
44+
varshortcutMatch=url.match(/^([^:]+):(?:[^@]+@)?(?:([^/]*)\/)?([^#]+)/)
4545
varmatches=Object.keys(gitHosts).map(function(gitHostName){
4646
try{
4747
vargitHostInfo=gitHosts[gitHostName]
@@ -55,7 +55,7 @@ function fromUrl (giturl, opts) {
5555
vardefaultRepresentation=null
5656
if(shortcutMatch&&shortcutMatch[1]===gitHostName){
5757
user=shortcutMatch[2]&&decodeURIComponent(shortcutMatch[2])
58-
project=decodeURIComponent(shortcutMatch[3])
58+
project=decodeURIComponent(shortcutMatch[3].replace(/\.git$/,''))
5959
defaultRepresentation='shortcut'
6060
}else{
6161
if(parsed.host&&parsed.host!==gitHostInfo.domain&&parsed.host.replace(/^www[.]/,'')!==gitHostInfo.domain)return

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp