-
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shorten no-referrer GitHub URLs too #33
Conversation
Co-authored-by: Federico Brigante <[email protected]>
Yeah it doesn't because those links are usually shortened natively. To properly add support for refined-github/refined-github#4981 the regular issues should also work. The example URL in that issue isn't shortened |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably good 😃
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally this should support issues and PRs even without isRedirection
, to both work as a general-purpose shortener (rather than extension-specific) and to (I think) support comment links like
Currently isRedirection
does not display that (comment)
/(review)
part
However non-isRedirection support isn't required for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
@@ -4,7 +4,9 @@ const patchDiffRegex = /[.](patch|diff)$/; | |||
const releaseRegex = /^releases[/]tag[/]([^/]+)/; | |||
const labelRegex = /^labels[/]([^/]+)/; | |||
const compareRegex = /^compare[/]([^/]+)/; | |||
const pullRegex = /^pull[/](\d+)[/]([^/]+)(?:[/]([\da-f]{40})[.][.]([\da-f]{40}))?$/; | |||
const pullRegex = /^pull[/](\d+)(?:[/]([^/]+))?(?:[/]([\da-f]{40})[.][.]([\da-f]{40}))?$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be good to use named groups here to describe what each group is capturing, even if unused. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes 👍
You can open a PR with the same title on refined GitHub and install just this dependency |
Fixes refined-github/refined-github#4981