diff options
author | Howl <git@howl.moe> | 2015-11-15 12:04:43 +0100 |
---|---|---|
committer | Howl <git@howl.moe> | 2015-11-15 12:04:43 +0100 |
commit | 85c58eba902b554822666acec78046379a17b598 (patch) | |
tree | f2561896fcfc77d8033d4d6cd7909be8be9b8b7a /modules/base | |
parent | 84a43b38cfe88f7199a5e883f00a0ef5091a69d0 (diff) | |
download | gitea-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.go | 3 |
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 |