]> source.dussan.org Git - gitea.git/commitdiff
Merge pull request #826 from deringer/dev
author无闻 <u@gogs.io>
Sat, 7 Feb 2015 00:03:35 +0000 (19:03 -0500)
committer无闻 <u@gogs.io>
Sat, 7 Feb 2015 00:03:35 +0000 (19:03 -0500)
Fix user mention bug when parsing markdown documents

1  2 
modules/base/markdown.go
public/ng/css/gogs.css

index d3f3e5feafac2755a2924b75e34f4e9020f849d7,f18d459ff6689b12accaeebc0de19e2bd789c436..87aafda3e1e7ae1178afb8ba2676b52b5458a118
@@@ -106,10 -100,10 +106,10 @@@ func (options *CustomRender) Image(out 
  }
  
  var (
-       MentionPattern     = regexp.MustCompile(`@[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]+`)
 +      issueIndexPattern  = regexp.MustCompile(`( |^)#[0-9]+`)
        sha1CurrentPattern = regexp.MustCompile(`\b[0-9a-f]{40}\b`)
  )
  
Simple merge