diff options
author | Steven <61625851+justusbunsi@users.noreply.github.com> | 2021-05-09 20:25:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-09 19:25:23 +0100 |
commit | 2e0f3156170dac30325a5fadd5ad3525b4a60e50 (patch) | |
tree | 38367c47d897a49fa1eb3fdfe95024174dce05d3 /modules/references/references.go | |
parent | a2df2654765c85cb7e7efc5eec9a97befa47bf15 (diff) | |
download | gitea-2e0f3156170dac30325a5fadd5ad3525b4a60e50.tar.gz gitea-2e0f3156170dac30325a5fadd5ad3525b4a60e50.zip |
Respect default merge message syntax when parsing item references (#15772)
* Respect merge message structure for parsing item references
Signed-off-by: JustusBunsi <61625851+justusbunsi@users.noreply.github.com>
Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'modules/references/references.go')
-rw-r--r-- | modules/references/references.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/references/references.go b/modules/references/references.go index 6c0db0cf47..106e66b47b 100644 --- a/modules/references/references.go +++ b/modules/references/references.go @@ -29,7 +29,7 @@ var ( // mentionPattern matches all mentions in the form of "@user" or "@org/team" mentionPattern = regexp.MustCompile(`(?:\s|^|\(|\[)(@[0-9a-zA-Z-_]+|@[0-9a-zA-Z-_]+\/?[0-9a-zA-Z-_]+|@[0-9a-zA-Z-_][0-9a-zA-Z-_.]+\/?[0-9a-zA-Z-_.]+[0-9a-zA-Z-_])(?:\s|[:,;.?!]\s|[:,;.?!]?$|\)|\])`) // issueNumericPattern matches string that references to a numeric issue, e.g. #1287 - issueNumericPattern = regexp.MustCompile(`(?:\s|^|\(|\[)([#!][0-9]+)(?:\s|$|\)|\]|[:;,.?!]\s|[:;,.?!]$)`) + issueNumericPattern = regexp.MustCompile(`(?:\s|^|\(|\[|\')([#!][0-9]+)(?:\s|$|\)|\]|[:;,.?!]\s|[:;,.?!]$)`) // issueAlphanumericPattern matches string that references to an alphanumeric issue, e.g. ABC-1234 issueAlphanumericPattern = regexp.MustCompile(`(?:\s|^|\(|\[)([A-Z]{1,10}-[1-9][0-9]*)(?:\s|$|\)|\]|:|\.(\s|$))`) // crossReferenceIssueNumericPattern matches string that references a numeric issue in a different repository |