]> source.dussan.org Git - gitea.git/commitdiff
Render full plain readme. (#17083) (#17090)
authorzeripath <art27@cantab.net>
Sun, 19 Sep 2021 14:01:19 +0000 (15:01 +0100)
committerGitHub <noreply@github.com>
Sun, 19 Sep 2021 14:01:19 +0000 (22:01 +0800)
Backport #17083

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
routers/web/repo/view.go

index 21bd80c406673ddb5eaf81094231e21e2f302217..2be81d7485cbb5493d154527c0016c7e75989c55 100644 (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>`,
                                        )