Преглед изворни кода

repo/view: trim Windows line ending when display content (#4546)

Unknwon пре 7 година
родитељ
комит
91f65cedc8
3 измењених фајлова са 3 додато и 3 уклоњено
  1. 1 1
      gogs.go
  2. 1 1
      routers/repo/view.go
  3. 1 1
      templates/.VERSION

+ 1 - 1
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

+ 1 - 1
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(`<li class="L%d" rel="L%d">%s</li>`, index+1, index+1, gotemplate.HTMLEscapeString(line)) + "\n")
+				output.WriteString(fmt.Sprintf(`<li class="L%d" rel="L%d">%s</li>`, index+1, index+1, gotemplate.HTMLEscapeString(strings.TrimRight(line, "\r"))) + "\n")
 			}
 			c.Data["FileContent"] = gotemplate.HTML(output.String())
 

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.11.18.0608
+0.11.19.0609