diff options
Diffstat (limited to 'routers/repo')
-rw-r--r-- | routers/repo/view.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index e8e1bacc4e..38260d2bec 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -93,10 +93,11 @@ func renderDirectory(ctx *context.Context, treeLink string) { if isTextFile { d, _ := ioutil.ReadAll(dataRc) buf = append(buf, d...) - ctx.Data["IsRenderedHTML"] = true if markup.Type(readmeFile.Name()) != "" { + ctx.Data["IsMarkup"] = true ctx.Data["FileContent"] = string(markup.Render(readmeFile.Name(), buf, treeLink, ctx.Repo.Repository.ComposeMetas())) } else { + ctx.Data["IsRenderedHTML"] = true ctx.Data["FileContent"] = string(bytes.Replace(buf, []byte("\n"), []byte(`<br>`), -1)) } } @@ -194,7 +195,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st readmeExist := markup.IsReadmeFile(blob.Name()) ctx.Data["ReadmeExist"] = readmeExist if markup.Type(blob.Name()) != "" { - ctx.Data["IsRenderedHTML"] = true + ctx.Data["IsMarkup"] = true ctx.Data["FileContent"] = string(markup.Render(blob.Name(), buf, path.Dir(treeLink), ctx.Repo.Repository.ComposeMetas())) } else if readmeExist { ctx.Data["IsRenderedHTML"] = true |