1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00

Render full plain readme. (#17083)

This commit is contained in:
KN4CK3R 2021-09-18 04:46:57 +02:00 committed by GitHub
parent 0b368aa73d
commit 8fb3a50a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -353,6 +353,10 @@ func renderDirectory(ctx *context.Context, treeLink string) {
}
} else {
ctx.Data["IsRenderedHTML"] = true
buf, err = ioutil.ReadAll(rd)
if err != nil {
log.Error("ReadAll failed: %v", err)
}
ctx.Data["FileContent"] = strings.ReplaceAll(
gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`,
)