diff options
author | Unknwon <u@gogs.io> | 2017-03-31 16:37:30 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-03-31 16:37:30 -0400 |
commit | 8da16ac302b78c4c6bad90cd5c8765de110c42af (patch) | |
tree | aa2ed0872bd03e4d7f53586dda0efdd60f3a354a /routers/repo/issue.go | |
parent | 761bb3cf53960485921ad045bae5a79340d66f97 (diff) |
modules/markup: rename Markdown render fucntions
The unified function 'Markdown' accepts both string or []byte type
input and renders to HTML with []byte type.
Diffstat (limited to 'routers/repo/issue.go')
-rw-r--r-- | routers/repo/issue.go | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/routers/repo/issue.go b/routers/repo/issue.go index 917bcad5..337e4948 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -541,8 +541,7 @@ func viewIssue(ctx *context.Context, isPullList bool) { ctx.Data["PageIsIssueList"] = true } - issue.RenderedContent = string(markup.Render([]byte(issue.Content), ctx.Repo.RepoLink, - ctx.Repo.Repository.ComposeMetas())) + issue.RenderedContent = string(markup.Markdown(issue.Content, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas())) repo := ctx.Repo.Repository @@ -608,8 +607,7 @@ func viewIssue(ctx *context.Context, isPullList bool) { participants[0] = issue.Poster for _, comment = range issue.Comments { if comment.Type == models.COMMENT_TYPE_COMMENT { - comment.RenderedContent = string(markup.Render([]byte(comment.Content), ctx.Repo.RepoLink, - ctx.Repo.Repository.ComposeMetas())) + comment.RenderedContent = string(markup.Markdown(comment.Content, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas())) // Check tag. tag, ok = marked[comment.PosterID] @@ -728,7 +726,7 @@ func UpdateIssueContent(ctx *context.Context) { } ctx.JSON(200, map[string]interface{}{ - "content": string(markup.Render([]byte(issue.Content), ctx.Query("context"), ctx.Repo.Repository.ComposeMetas())), + "content": markup.Markdown(issue.Content, ctx.Query("context"), ctx.Repo.Repository.ComposeMetas()), }) } @@ -939,7 +937,7 @@ func UpdateCommentContent(ctx *context.Context) { } ctx.JSON(200, map[string]interface{}{ - "content": string(markup.Render([]byte(comment.Content), ctx.Query("context"), ctx.Repo.Repository.ComposeMetas())), + "content": markup.Markdown(comment.Content, ctx.Query("context"), ctx.Repo.Repository.ComposeMetas()), }) } @@ -1092,7 +1090,7 @@ func Milestones(ctx *context.Context) { if m.NumOpenIssues+m.NumClosedIssues > 0 { m.Completeness = m.NumClosedIssues * 100 / (m.NumOpenIssues + m.NumClosedIssues) } - m.RenderedContent = string(markup.Render([]byte(m.Content), ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas())) + m.RenderedContent = string(markup.Markdown(m.Content, ctx.Repo.RepoLink, ctx.Repo.Repository.ComposeMetas())) } ctx.Data["Milestones"] = miles |