File tree 2 files changed +2
-1
lines changed
2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change 49
49
// hashCurrentPattern matches string that represents a commit SHA, e.g. d8a994ef243349f321568f9e36d5c3f444b99cae
50
50
// Although SHA1 hashes are 40 chars long, SHA256 are 64, the regex matches the hash from 7 to 64 chars in length
51
51
// so that abbreviated hash links can be used as well. This matches git and GitHub usability.
52
- hashCurrentPattern = regexp .MustCompile (`(?:\s|^|\(|\[)([0-9a-f]{7,64})(?:\s|$|\)|\]|[.,](\s|$))` )
52
+ hashCurrentPattern = regexp .MustCompile (`(?:\s|^|\(|\[)([0-9a-f]{7,64})(?:\s|$|\)|\]|[.,: ](\s|$))` )
53
53
54
54
// shortLinkPattern matches short but difficult to parse [[name|link|arg=test]] syntax
55
55
shortLinkPattern = regexp .MustCompile (`\[\[(.*?)\]\](\w*)` )
Original file line number Diff line number Diff line change @@ -380,6 +380,7 @@ func TestRegExp_sha1CurrentPattern(t *testing.T) {
380
380
"(abcdefabcdefabcdefabcdefabcdefabcdefabcd)" ,
381
381
"[abcdefabcdefabcdefabcdefabcdefabcdefabcd]" ,
382
382
"abcdefabcdefabcdefabcdefabcdefabcdefabcd." ,
383
+ "abcdefabcdefabcdefabcdefabcdefabcdefabcd:" ,
383
384
}
384
385
falseTestCases := []string {
385
386
"test" ,
You can’t perform that action at this time.
0 commit comments