sindresorhus/refined-github

Prevent discussion comment link loss #4357

FloEdelmann posted onGitHub

Originally posted by @smichel17 in https://github.com/streetcomplete/StreetComplete/issues/2283#issuecomment-840723380:

There is one annoying bug where GitHub's auto-shorten feature messes up if you have any query params. So, https://github.com/streetcomplete/StreetComplete/discussions/2789?sort=top#discussioncomment-646707 gets shortened to https://github.com/streetcomplete/StreetComplete/discussions/2789?sort=top#discussioncomment-646707 and links the top-level discussion instead of #2789 (comment) (this link created manually).

  • …/discussions/2789?sort=top#discussioncomment-646707 → #2789 :x:
  • …/discussions/2789?sort=top → #2789 :x:
  • …/discussions/2789#discussioncomment-646707 → #2789 (comment) :heavy_check_mark:
  • …/discussions/2789 → #2789 :heavy_check_mark:

Maybe this case could be added to prevent-pr-commit-link-loss? (And rename the feature to prevent-link-loss then?)


If accepted I would make it its own feature and just export common items. That feature is complex enough as it is.

posted by yakov116 almost 4 years ago

It doesn’t look too complex, I think it can be improved. For example the 2 existing replacement regexes could be joined with regex-join (plus 1 more regex coming here) so the condition would be just one.

Maybe the “complex” part would be matching the DOM.

I don’t mind duplicating the feature to get started, but it can probably be merged once it’s ready.

posted by fregante almost 4 years ago

Fund this Issue

$0.00
Funded

Pull requests