sindresorhus/refined-github

settings: link to issues are broken #2460

muescha posted onGitHub

where:

  • open settings
  • hoover over issue link

what i see:

  • a link chrome-extension://hlepfoohegkhhmjieoechaddaejaokhf/options.html///issues/2041

what i expected:

  • a link to https://github.com/sindresorhus/refined-github/issues/2041

screenshot:

see link in left bottom statusline:

Bildschirmfoto 2019-09-26 um 23 52 49


I think this line:

https://github.com/sindresorhus/refined-github/blob/4c3f647008fc17c8953512b70100810d7d1ce7eb/source/libs/dom-formatters.ts#L21

Has to be changed to

        baseUrl: location.protocol.startsWith('http') ? '' : 'https://github.com/sindresorhus/refined-github/',

But needs testing

posted by fregante over 5 years ago

Looked into this a bit and sadly there are two problems to @fregante's solution. The currentRepo.ownerName is options.html so it will be converted to .../refined-github//options.html///issues/.... We could try to fix the parsing or handle this case but then it would still generate an url with empty path parts .../refined-github//////issues/.... This still resolves correctly, but just doesn't look nice imo.

My suggestion would be to allow overwriting the options of linkifyIssues.

// options.tsx
domFormatters.linkifyIssues(descriptionElement, {
    baseUrl: 'https://github.com',
    user: 'sindresorhus',
    repository: 'refined-github'
});
posted by dertieran over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests