File tree Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Expand file tree Collapse file tree 2 files changed +2
-1
lines changed Original file line number Diff line number Diff line change 4949 // hashCurrentPattern matches string that represents a commit SHA, e.g. d8a994ef243349f321568f9e36d5c3f444b99cae
5050 // Although SHA1 hashes are 40 chars long, SHA256 are 64, the regex matches the hash from 7 to 64 chars in length
5151 // 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|$))` )
5353
5454 // shortLinkPattern matches short but difficult to parse [[name|link|arg=test]] syntax
5555 shortLinkPattern = regexp .MustCompile (`\[\[(.*?)\]\](\w*)` )
Original file line number Diff line number Diff line change @@ -380,6 +380,7 @@ func TestRegExp_sha1CurrentPattern(t *testing.T) {
380380 "(abcdefabcdefabcdefabcdefabcdefabcdefabcd)" ,
381381 "[abcdefabcdefabcdefabcdefabcdefabcdefabcd]" ,
382382 "abcdefabcdefabcdefabcdefabcdefabcdefabcd." ,
383+ "abcdefabcdefabcdefabcdefabcdefabcdefabcd:" ,
383384 }
384385 falseTestCases := []string {
385386 "test" ,
You can’t perform that action at this time.
0 commit comments