From 91f65cedc88729b5504d72647185d685083df773 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 9 Jun 2017 20:05:04 -0400 Subject: [PATCH] repo/view: trim Windows line ending when display content (#4546) --- gogs.go | 2 +- routers/repo/view.go | 2 +- templates/.VERSION | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gogs.go b/gogs.go index 7cf99ee67..97d221466 100644 --- a/gogs.go +++ b/gogs.go @@ -16,7 +16,7 @@ import ( "github.com/gogits/gogs/pkg/setting" ) -const APP_VER = "0.11.18.0608" +const APP_VER = "0.11.19.0609" func init() { setting.AppVer = APP_VER diff --git a/routers/repo/view.go b/routers/repo/view.go index a4096ff96..1ea25d51f 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()) diff --git a/templates/.VERSION b/templates/.VERSION index d92fefef3..95335b2f5 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.11.18.0608 \ No newline at end of file +0.11.19.0609 \ No newline at end of file