Render full plain readme. (#17083)

tokarchuk/v1.17
KN4CK3R 3 years ago committed by GitHub
parent 0b368aa73d
commit 8fb3a50a37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      routers/web/repo/view.go

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

Loading…
Cancel
Save