summaryrefslogtreecommitdiffstats
path: root/modules/base
diff options
context:
space:
mode:
authorHowl <git@howl.moe>2015-11-15 12:04:43 +0100
committerHowl <git@howl.moe>2015-11-15 12:04:43 +0100
commit85c58eba902b554822666acec78046379a17b598 (patch)
treef2561896fcfc77d8033d4d6cd7909be8be9b8b7a /modules/base
parent84a43b38cfe88f7199a5e883f00a0ef5091a69d0 (diff)
downloadgitea-85c58eba902b554822666acec78046379a17b598.tar.gz
gitea-85c58eba902b554822666acec78046379a17b598.zip
Fix bad issue links in non-readme markdown files
Diffstat (limited to 'modules/base')
-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