Skip to content

Commit

Permalink
Render full plain readme. (#17083)
Browse files Browse the repository at this point in the history
  • Loading branch information
KN4CK3R authored Sep 18, 2021
1 parent 0b368aa commit 8fb3a50
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 8fb3a50

Please sign in to comment.