We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4476f9 commit 4b138caCopy full SHA for 4b138ca
links.js
@@ -15,20 +15,27 @@ function createLink(linkData) {
15
let link = '';
16
17
if (linkData.dir) {
18
-
19
- link += '/' +
20
- encodeURI(
21
- linkData.dir.join('/')
22
- );
23
24
25
- if (linkData.file) {
26
27
28
29
- linkData.file.name
30
31
+
+ [user, repo, contents] = linkData.dir;
+ if (user && repo) {
+ link += '/' + encodeURIComponent(user) +
+ '/' + encodeURIComponent(repo);
+ if (contents) {
+ link += '/' + encodeURIComponent(contents);
+ }
32
33
+ if (linkData.file) {
34
35
+ link += '/' + encodeURIComponent(linkData.file.name);
36
37
38
39
}
40
41
0 commit comments