Skip to content

Commit

Permalink
Adjust wiki format
Browse files Browse the repository at this point in the history
  • Loading branch information
Katsute committed Sep 12, 2023
1 parent 75a214b commit 28656b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function shortenURL(href, currentUrl = 'https://github.com') {
}

if (wiki) {
return `${repoUrl} (wiki) ${decodeURIComponent((wiki + (hash ? ' (' + hash.slice(1) + ')' : '')).replaceAll('-', ' '))}`;
return `Wiki: ${decodeURIComponent((wiki + (hash ? ' (' + hash.slice(1) + ')' : '')).replaceAll('-', ' '))} (${repoUrl})`;
}

// Shorten URLs that would otherwise be natively shortened
Expand Down
6 changes: 3 additions & 3 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -484,14 +484,14 @@ test('GitHub.com URLs', urlMatcherMacro, new Map([
],
[
'https://github.com/refined-github/refined-github/wiki/%22Can-you-add-this-feature%3F%22#3-it-doesnt-require-options',
'refined-github/refined-github (wiki) "Can you add this feature?" (3 it doesnt require options)',
'Wiki: "Can you add this feature?" (3 it doesnt require options) (refined-github/refined-github)',
],
[
'https://github.com/refined-github/refined-github/wiki/%22Can-you-add-this-feature%3F%22#',
'refined-github/refined-github (wiki) "Can you add this feature?"',
'Wiki: "Can you add this feature?" (refined-github/refined-github)',
],
[
'https://github.com/refined-github/refined-github/wiki/%22Can-you-add-this-feature%3F%22',
'refined-github/refined-github (wiki) "Can you add this feature?"',
'Wiki: "Can you add this feature?" (refined-github/refined-github)',
],
]));

0 comments on commit 28656b0

Please sign in to comment.