aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKN4CK3R <admin@oldschoolhack.me>2021-09-18 04:46:57 +0200
committerGitHub <noreply@github.com>2021-09-17 21:46:57 -0500
commit8fb3a50a3791147f992089f8b9f986e9b94542d8 (patch)
treed84d6774be5a191f540e7825910af1d9dccaf69b
parent0b368aa73d54eca0d30de3c4a580eadadabbe3e3 (diff)
downloadgitea-8fb3a50a3791147f992089f8b9f986e9b94542d8.tar.gz
gitea-8fb3a50a3791147f992089f8b9f986e9b94542d8.zip
Render full plain readme. (#17083)
-rw-r--r--routers/web/repo/view.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go
index 2c703fc1af..c71562f271 100644
--- a/routers/web/repo/view.go
+++ b/routers/web/repo/view.go
@@ -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>`,
)