Skip to content

Commit

Permalink
Render full plain readme. (#17083) (#17090)
Browse files Browse the repository at this point in the history
Backport #17083

Co-authored-by: KN4CK3R <[email protected]>

Co-authored-by: KN4CK3R <[email protected]>
  • Loading branch information
zeripath and KN4CK3R authored Sep 19, 2021
1 parent fd35f56 commit b673a24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions routers/web/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -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>`,
)
Expand Down

0 comments on commit b673a24

Please sign in to comment.