From 91f65cedc88729b5504d72647185d685083df773 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 9 Jun 2017 20:05:04 -0400 Subject: repo/view: trim Windows line ending when display content (#4546) --- routers/repo/view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'routers') diff --git a/routers/repo/view.go b/routers/repo/view.go index a4096ff9..1ea25d51 100644 --- a/routers/repo/view.go +++ b/routers/repo/view.go @@ -186,7 +186,7 @@ func renderFile(c *context.Context, entry *git.TreeEntry, treeLink, rawLink stri var output bytes.Buffer lines := strings.Split(fileContent, "\n") for index, line := range lines { - output.WriteString(fmt.Sprintf(`
  • %s
  • `, index+1, index+1, gotemplate.HTMLEscapeString(line)) + "\n") + output.WriteString(fmt.Sprintf(`
  • %s
  • `, index+1, index+1, gotemplate.HTMLEscapeString(strings.TrimRight(line, "\r"))) + "\n") } c.Data["FileContent"] = gotemplate.HTML(output.String()) -- cgit v1.2.3