aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base/markdown.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/base/markdown.go')
-rw-r--r--modules/base/markdown.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/base/markdown.go b/modules/base/markdown.go
index 8f3d6bef1a..70c2918af0 100644
--- a/modules/base/markdown.go
+++ b/modules/base/markdown.go
@@ -168,6 +168,9 @@ func RenderSha1CurrentPattern(rawBytes []byte, urlPrefix string) []byte {
}
func RenderIssueIndexPattern(rawBytes []byte, urlPrefix string) []byte {
+ // Remove unnecessary things after username and reponame in prefix
+ // (otherwise stuff like /:user/:repo/src/master/issues/1 would happen)
+ urlPrefix = strings.Join(strings.Split(urlPrefix, "/")[:3], "/")
ms := issueIndexPattern.FindAll(rawBytes, -1)
for _, m := range ms {
var space string