From b673a24ee6bc5429bea1023437aaec8c61ba8851 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sun, 19 Sep 2021 15:01:19 +0100 Subject: [PATCH] Render full plain readme. (#17083) (#17090) Backport #17083 Co-authored-by: KN4CK3R Co-authored-by: KN4CK3R --- routers/web/repo/view.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index 21bd80c406..2be81d7485 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", `
`, ) -- 2.39.5