Refined-github: Fix PR commit links on submission (GitHub鈥檚 bug)

Created on 13 Aug 2019  路  11Comments  路  Source: sindresorhus/refined-github


Issuehunt badges

GitHub has had this really annoying bug that changes PR commit links (e.g. this one) into non-PR-related links like this: https://github.com/sindresorhus/refined-github/commit/cb44a4eb8cd5c66def3dc26dca0f386645fa29bb

This only happens to auto-linked URLS like https://...etc and not to [text](https://...etc)

We can't fix these links after they've been submitted but we can do it before submission.


This feature should should:

  1. Listen to comment form submissions
  2. Detect plain URLs to PR commits (and skip markdown links)
  3. Replace plain urls with identical markdown links, like [https://...etc](https://...etc)

Step 2 is easy to implement in most places (e.g. find a URL surrounded by spaces) but it can be tripped with content like [this url https://... is the problem](https://...) (which... probably does not happen)

Test comment content:

https://github.com/sindresorhus/refined-github/pull/3/commits/cb44a4eb8cd5c66def3dc26dca0f386645fa29bb




IssueHunt Summary

max-arias max-arias has been rewarded.

Backers (Total: $18.81)

Submitted pull Requests

- #3085 Added feature to stop GH from replacing Pr links to commit links

Tips


Rewarded on Issuehunt Please! 鈾ワ笌 enhancement help wanted

Most helpful comment

This is really cool鈥攖he find of feature that makes me proud to use Refined GitHub. Nice work everyone. The styling of the warning is especially nice.

All 11 comments

cc @lukehefson just in case he can fix this internally.

Thanks for the ping @fregante! Did you submit a bug report to our Support team? And if so, do you think you could DM (twitter, email) me the ticket reference?

@fregante has funded $18.81 to this issue.


looks like this was solved?

Nope. I just posted 1 but the link points to 2

1. https://github.com/sindresorhus/refined-github/pull/3/commits/cb44a4eb8cd5c66def3dc26dca0f386645fa29bb
2. https://github.com/sindresorhus/refined-github/commit/cb44a4eb8cd5c66def3dc26dca0f386645fa29bb

This issue is considered solved (by GitHub) when the link I just posted points to a PR commit, not a plain commit.

I'll give this a shot!

@sindresorhus has rewarded $16.92 to @max-arias. See it on IssueHunt

  • :moneybag: Total deposit: $18.81
  • :tada: Repository reward(0%): $0.00
  • :wrench: Service fee(10%): $1.89

This is really cool鈥攖he find of feature that makes me proud to use Refined GitHub. Nice work everyone. The styling of the warning is especially nice.

Glad you like it, this bug annoyed me for a long time.

Some fixes to this feature are coming in #3223

Was this page helpful?
0 / 5 - 0 ratings