File tree 1 file changed +2
-14
lines changed
1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -290,18 +290,6 @@ function shortenRepoUrl(href, currentUrl = 'https://github.com') {
290
290
* @type {(url: string) => string }
291
291
*/
292
292
function safeDecode ( url ) {
293
- try {
294
- return decodeURIComponent ( url ) ;
295
- } catch {
296
- return url ;
297
- }
298
- }
299
-
300
- /**
301
- * Handle non-URL gracefully
302
- * @type {(url: string) => string }
303
- */
304
- function safeHref ( url ) {
305
293
try {
306
294
return new URL ( url ) . href ;
307
295
} catch {
@@ -316,8 +304,8 @@ function getLinkHref(a) {
316
304
317
305
/** @param a {HTMLAnchorElement} */
318
306
function isCustomLink ( a ) {
319
- const url = safeHref ( getLinkHref ( a ) ) ;
320
- const label = safeHref ( a . textContent ) ;
307
+ const url = safeDecode ( getLinkHref ( a ) ) ;
308
+ const label = safeDecode ( a . textContent ) ;
321
309
return (
322
310
// `trim` makes it compatible with this feature: https://github.com/sindresorhus/refined-github/pull/3085
323
311
url !== label . trim ( )
You can’t perform that action at this time.
0 commit comments