Browse Source

Fix readme render bug (#15649)

tags/v1.15.0-rc1
Lunny Xiao 4 years ago committed by GitHub
parent
commit
d7dbe4feeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      routers/repo/view.go

1
routers/repo/view.go

@ -512,6 +512,7 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
}
ctx.Data["FileContent"] = result.String()
} else if readmeExist {
buf, _ := ioutil.ReadAll(rd)
ctx.Data["IsRenderedHTML"] = true
ctx.Data["FileContent"] = strings.ReplaceAll(
gotemplate.HTMLEscapeString(string(buf)), "\n", `<br>`,

Loading…
Cancel
Save