Skip to content

Commit

Permalink
Render full plain readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
KN4CK3R committed Sep 17, 2021
1 parent 27b351a commit 7a02886
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 7a02886

Please sign in to comment.