diff --git a/index.js b/index.js index 91a6c43..6297033 100644 --- a/index.js +++ b/index.js @@ -147,7 +147,7 @@ function shortenURL(href, currentUrl = 'https://github.com') { } if (label) { - return joinValues([repoUrl, label]) + `${search}${hash} (label)`; + return joinValues([repoUrl, decodeURIComponent(label)]) + `${search}${hash} (label)`; } if (isDependents) { diff --git a/test.js b/test.js index f0b82d3..1d91793 100644 --- a/test.js +++ b/test.js @@ -198,6 +198,10 @@ test('GitHub.com URLs', urlMatcherMacro, new Map([ 'https://github.com/nodejs/node/labels/npm', 'nodejs/node/npm (label)' ], + [ + 'https://github.com/nodejs/node/labels/Please%21%20♥', + 'nodejs/node/Please! ♥ (label)' + ], [ 'https://github.com/fregante/shorten-repo-url/archive/6.4.1.zip', '6.4.1.zip'