diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2021-04-29 04:22:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-28 22:22:54 +0200 |
commit | d7dbe4feebac7805a4ca184f0989f58de8063d96 (patch) | |
tree | 5d70d5ccefd35810012b90eda97cc82de7221f0e /routers | |
parent | 2c57352a30307ba274651ff2a93cc12b4afe9316 (diff) | |
download | gitea-d7dbe4feebac7805a4ca184f0989f58de8063d96.tar.gz gitea-d7dbe4feebac7805a4ca184f0989f58de8063d96.zip |
Fix readme render bug (#15649)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/repo/view.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/routers/repo/view.go b/routers/repo/view.go index 10deb7065a..285cacc2df 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -512,6 +512,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st } ctx.Data["FileContent"] = result.String() } else if readmeExist { + buf, _ := ioutil.ReadAll(rd) ctx.Data["IsRenderedHTML"] = true ctx.Data["FileContent"] = strings.ReplaceAll( gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`, |