sindresorhus/refined-github

"shorten-links" should be limited to internal GitHub links only or be configurable. #4025

gwarser posted onGitHub

For example here https://gist.github.com/grahamperrin/219a681fadb4a354782c2b64f39d6725

text mentions www but shortener removed subdomain, it is not displayed - confusing.

Another example: if you copy link from https://github.com/Rob--W/crxviewer/issues/43#issuecomment-766272556 by selecting it to include incorrectly parsed part (and then correctly filling EXTENSION_ID value), it will not work because browser will interpret it as not secure http. I hit this issue few times already.


GitHub is about code after all - it should be precise.


GitHub is about code after all

If you want code, you should use <code>``</code>. Comments are not code, they're Markdown and adapted by GitHub in various ways, from the inability to start lines with # to link shortening, which is native to GitHub. Live example: https://github.com/sindresorhus/refined-github/issues/4025#issue-817368095

I already can't copy-paste this comment without losing that link. That's a native GitHub feature.

shorten-links is an extension to GitHub’s own auto-linkifier and link shortener and as such I feel that it's justified.

shorten-links can also be disabled; GitHub’s can't. Or you can use code in both cases.


Regarding the issue specifically, this isn't specific to external URLs. In #4015 the user typed

https://github.com/<organisation>/<project>/pull/1216

Which was rendered as this by GitHub:

<a href="https://github.com/">https://github.com</a>//<a href="https://github.com/sindresorhus/refined-github/pull/1216">/pull/1216</a>

Because, again, this is rendered Markdown, not code, therefore <organization> is treated as an HTML tag and hidden.

In short, if you want code, use code

posted by fregante about 4 years ago

I'm sympathetic to the issue, but shorten-links only highlights it, it doesn't cause it.

If other people post broken links often enough, you can disable the feature.

posted by fregante about 4 years ago

Other than disabling/removing the feature, are there any possible improvements?

posted by fregante about 4 years ago

Fund this Issue

$0.00
Funded

Pull requests