From 066989722626deb9e0de1ea0cbe158aa387d8d26 Mon Sep 17 00:00:00 2001 From: Unknwon <joe2010xtmf@163.com> Date: Fri, 6 Feb 2015 19:15:58 -0500 Subject: modules/base: fix markdown mention regex for #826 - conf/locale: add mew translator profile --- modules/base/markdown.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/base/markdown.go') diff --git a/modules/base/markdown.go b/modules/base/markdown.go index 87aafda3..41220986 100644 --- a/modules/base/markdown.go +++ b/modules/base/markdown.go @@ -106,7 +106,7 @@ func (options *CustomRender) Image(out *bytes.Buffer, link []byte, title []byte, } var ( - MentionPattern = regexp.MustCompile(`(\s@)[0-9a-zA-Z_]{1,}`) + MentionPattern = regexp.MustCompile(`((^|\s)@)[0-9a-zA-Z_]{1,}`) 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]+`) -- cgit v1.2.3