summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
Diffstat (limited to 'routers')
-rw-r--r--routers/api/v1/miscellaneous.go2
-rw-r--r--routers/repo/issue.go8
2 files changed, 5 insertions, 5 deletions
diff --git a/routers/api/v1/miscellaneous.go b/routers/api/v1/miscellaneous.go
index 0ff1eb04a0..babdfce9b2 100644
--- a/routers/api/v1/miscellaneous.go
+++ b/routers/api/v1/miscellaneous.go
@@ -13,6 +13,6 @@ func Markdown(ctx *middleware.Context) {
content := ctx.Query("content")
ctx.Render.JSON(200, map[string]interface{}{
"ok": true,
- "content": string(base.RenderMarkdown([]byte(content), "")),
+ "content": string(base.RenderMarkdown([]byte(content), ctx.Query("repoLink"))),
})
}
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index be92542641..38522e0c70 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -147,7 +147,7 @@ func ViewIssue(ctx *middleware.Context, params martini.Params) {
return
}
issue.Poster = u
- issue.RenderedContent = string(base.RenderMarkdown([]byte(issue.Content), ""))
+ issue.RenderedContent = string(base.RenderMarkdown([]byte(issue.Content), ctx.Repo.RepoLink))
// Get comments.
comments, err := models.GetIssueComments(issue.Id)
@@ -164,7 +164,7 @@ func ViewIssue(ctx *middleware.Context, params martini.Params) {
return
}
comments[i].Poster = u
- comments[i].Content = string(base.RenderMarkdown([]byte(comments[i].Content), ""))
+ comments[i].Content = string(base.RenderMarkdown([]byte(comments[i].Content), ctx.Repo.RepoLink))
}
ctx.Data["Title"] = issue.Name
@@ -193,7 +193,7 @@ func UpdateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
return
}
- if ctx.User.Id != issue.PosterId {
+ if ctx.User.Id != issue.PosterId && !ctx.Repo.IsOwner {
ctx.Handle(404, "issue.UpdateIssue", nil)
return
}
@@ -211,7 +211,7 @@ func UpdateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
ctx.JSON(200, map[string]interface{}{
"ok": true,
"title": issue.Name,
- "content": string(base.RenderMarkdown([]byte(issue.Content), "")),
+ "content": string(base.RenderMarkdown([]byte(issue.Content), ctx.Repo.RepoLink)),
})
}