Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 9bb352d

Browse files
WliuWliu
Wliu
authored and
Wliu
committed
Copy wiki URLs correctly
1 parent f193b79 commit 9bb352d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/github-file.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ export default class GitHubFile {
153153
const encodedSHA = this.encodeSegments(this.sha())
154154
const repoRelativePath = this.repoRelativePath()
155155

156-
if (this.isGistURL(gitHubRepoURL)) {
156+
if (this.isGitHubWikiURL(gitHubRepoURL)) {
157+
return `${gitHubRepoURL.slice(0, -5)}/wiki/${this.extractFileName(repoRelativePath)}/${encodedSHA}`
158+
} else if (this.isGistURL(gitHubRepoURL)) {
157159
return `${gitHubRepoURL}/${encodedSHA}#file-${this.encodeSegments(repoRelativePath.replace(/\./g, '-'))}`
158160
} else {
159161
return `${gitHubRepoURL}/blob/${encodedSHA}/${this.encodeSegments(repoRelativePath)}`

0 commit comments

Comments
 (0)