File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -26,16 +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
- ## Main repository; forbid prefix of "/" to avoid conflation with
29
+ ## Main repository; forbid any lowercase alphabetical prefix to avoid conflation with
30
30
## other monotree repos like bitcoin-core/gui. Require at least a
31
31
## double-digit number to reduce false positive matches (e.g. "fix thing,
32
32
## try #2")
33
- output . gsub! ( /(^|[^\/ ])#([0-9]+)/ ) { |s |
33
+ output . gsub! ( /(^|[^a-z ])#([0-9] [0-9]+)/ ) { |s |
34
34
$1 + '<a href="' + @repository_url + '/pull/' + $2 + '">#' + $2 + '</a>'
35
35
}
36
36
37
- ## Other monotree repos; for repo "bitcoin-core/foo", PR format is "foo/#123"
38
- output . gsub! ( /([a-z]+)\/ #([0-9]+)/ ) { |s |
37
+ ## Other monotree repos; for repo "bitcoin-core/foo", PR format is "foo#123".
38
+ ## Must start at word boundary
39
+ output . gsub! ( /\b ([a-z]+)#([0-9]+)/ ) { |s |
39
40
'<a href="https://github.com/bitcoin-core/' + $1 + '/pull/' + $2 + '">' + s + '</a>'
40
41
}
41
42
You can’t perform that action at this time.
0 commit comments