#Mask Github Issue and PR Links

1 messages ยท Page 1 of 1 (latest)

austere obsidian
#

Would be cool when the REGEX automatically checks if you wrap the link in <> or not and then shows the embed or not

full herald
#

make it capture the repo and specify that

uncut dove
#

If you want it to grab the Repo, you can use this
Issue

Find: (https:\/\/github\.com\/[^\/]+\/([^\/]+)\/issues\/([0-9a-f]{1,}))
Replace: [`$2 #$3`]($1)

PR

Find: (https:\/\/github\.com\/[^\/]+\/([^\/]+)\/pull\/([0-9a-f]{1,}))
Replace: [`$2 #$3`]($1)
#

I actually like that a lot

velvet scaffold
#

pretty nice thumbsup

robust apex
uncut dove
#

Oh right, I put a hashtag lul, let me fix

full herald
uncut dove
#

I think I made the photo used, but the emoji itself is from my public server

gleaming tangle
#

What about the repo itself.
So it would do user/repo

uncut dove
#

I would have to test it to be sure, however I think you can just move the first parentheses back a few characters.
(https:\/\/github\.com\/([^\/]+\/[^\/]+)\/pull\/([0-9a-f]{1,}))
And it should work. I will test it tomorrow to be certain.

sleek onyx
#

Fun fact, you don't need to put parenthesis around the whole match $& exist for that purpose

#

Issue

Find: https:\/\/github\.com\/[^\/]+\/[^\/]+\/issues\/([0-9a-f]{1,})
Replace: [`Issue #$1`]($&)

No Embed version

Find: https:\/\/github\.com\/[^\/]+\/[^\/]+\/issues\/([0-9a-f]{1,})
Replace: [`Issue #$1`](<$&>)

Pull Requests

Find: https:\/\/github\.com\/[^\/]+\/[^\/]+\/pull\/([0-9a-f]{1,})
Replace: [`Pull Request #$1`]($&)

No Embed Version

Find: https:\/\/github\.com\/[^\/]+\/[^\/]+\/pull\/([0-9a-f]{1,})
Replace: [`Pull Request #$1`](<$&>)
uncut dove
#

Oh cool, thank you! I am only just starting to learn RedEx(I am having a lot of fun with it), I found a really useful site that actually lets you put in your expression, tells you what each part of it will do, and lets you test it. So if anyone else also wants to try and make some of these, the website is https://regexr.com/

RegExr

RegExr is an online tool to learn, build, & test Regular Expressions (RegEx / RegExp).

uncut dove
sleek onyx
lunar axle