diff options
author | Unknwon <u@gogs.io> | 2015-12-12 16:01:54 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-12-12 16:01:54 -0500 |
commit | 5911fc3512c81af1c7a3f2e8478171dff5b989d6 (patch) | |
tree | 3c019bcc4153f95ba59d1f7a0539ed27fce615b6 /modules/base | |
parent | 4108c12092db34cf80e53c6e7124615b1acb6c80 (diff) | |
download | gitea-5911fc3512c81af1c7a3f2e8478171dff5b989d6.tar.gz gitea-5911fc3512c81af1c7a3f2e8478171dff5b989d6.zip |
#2161 No issue linking in commits when issue number in brackets
Diffstat (limited to 'modules/base')
-rw-r--r-- | modules/base/markdown.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go index 1934b00851..199e88f973 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -133,7 +133,7 @@ var ( MentionPattern = regexp.MustCompile(`(\s|^)@[0-9a-zA-Z_\.]+`) commitPattern = regexp.MustCompile(`(\s|^)https?.*commit/[0-9a-zA-Z]+(#+[0-9a-zA-Z-]*)?`) issueFullPattern = regexp.MustCompile(`(\s|^)https?.*issues/[0-9]+(#+[0-9a-zA-Z-]*)?`) - issueIndexPattern = regexp.MustCompile(`( |^)#[0-9]+\b`) + issueIndexPattern = regexp.MustCompile(`(^|\W)#[0-9]+\b`) sha1CurrentPattern = regexp.MustCompile(`\b[0-9a-f]{40}\b`) ) @@ -156,8 +156,8 @@ func RenderIssueIndexPattern(rawBytes []byte, urlPrefix string, metas map[string for _, m := range ms { var space string m2 := m - if m2[0] == ' ' { - space = " " + if m2[0] != '#' { + space = string(m2[0]) m2 = m2[1:] } if metas == nil { |