mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 20:02:09 +00:00
feat: highlight issue references with : (#8101)
* feat: highlight issue references with : e.g. #1287: my commit msg e.g. ABC-1234: my commit msg * ref: update model regex to consistent with issueNumericPattern * test: check highlight issue with : in commits messages
This commit is contained in:
parent
79c8bc0e51
commit
b660a732ae
4 changed files with 11 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue