summaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
Diffstat (limited to 'models')
-rw-r--r--models/action.go2
-rw-r--r--models/action_test.go1
2 files changed, 2 insertions, 1 deletions
diff --git a/models/action.go b/models/action.go
index d3b53f6738..87088101f9 100644
--- a/models/action.go
+++ b/models/action.go
@@ -65,7 +65,7 @@ var (
)
const issueRefRegexpStr = `(?:([0-9a-zA-Z-_\.]+)/([0-9a-zA-Z-_\.]+))?(#[0-9]+)+`
-const issueRefRegexpStrNoKeyword = `(?:\s|^|\(|\[)(?:([0-9a-zA-Z-_\.]+)/([0-9a-zA-Z-_\.]+))?(#[0-9]+)(?:\s|$|\)|\]|\.(\s|$))`
+const issueRefRegexpStrNoKeyword = `(?:\s|^|\(|\[)(?:([0-9a-zA-Z-_\.]+)/([0-9a-zA-Z-_\.]+))?(#[0-9]+)(?:\s|$|\)|\]|:|\.(\s|$))`
func assembleKeywordsPattern(words []string) string {
return fmt.Sprintf(`(?i)(?:%s)(?::?) %s`, strings.Join(words, "|"), issueRefRegexpStr)
diff --git a/models/action_test.go b/models/action_test.go
index e2546044d4..16fdc7adcc 100644
--- a/models/action_test.go
+++ b/models/action_test.go
@@ -186,6 +186,7 @@ func TestRegExp_issueReferenceKeywordsPat(t *testing.T) {
"#2",
"[#2]",
"please see go-gitea/gitea#5",
+ "#2:",
}
falseTestCases := []string{
"kb#2",