File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -26,9 +26,17 @@ def render(context)
26
26
## Convert #1234 into URL for the pull request
27
27
## If #1234 links to an issue, GitHub automatically redirects
28
28
#
29
- ## Require at least two digits to reduce false positive matches
30
- output . gsub! ( /#([0-9][0-9][0-9]*)/ ) { |s |
31
- '<a href="' + @repository_url + '/pull/' + $1 + '">' + s + '</a>'
29
+ ## Main repository; forbid prefix of "/" to avoid conflation with
30
+ ## other monotree repos like bitcoin-core/gui. Require at least a
31
+ ## double-digit number to reduce false positive matches (e.g. "fix thing,
32
+ ## try #2")
33
+ output . gsub! ( /(^|[^\/ ])#([0-9]+)/ ) { |s |
34
+ $1 + '<a href="' + @repository_url + '/pull/' + $2 + '">#' + $2 + '</a>'
35
+ }
36
+
37
+ ## Other monotree repos; for repo "bitcoin-core/foo", PR format is "foo/#123"
38
+ output . gsub! ( /([a-z]+)\/ #([0-9]+)/ ) { |s |
39
+ '<a href="https://github.com/bitcoin-core/' + $1 + '/pull/' + $2 + '">' + s + '</a>'
32
40
}
33
41
34
42
## Convert `123abcd` into URL for the commit
You can’t perform that action at this time.
0 commit comments