mirror of https://github.com/gogs/gogs.git
repo/view: trim Windows line ending when display content (#4546)
parent
7b85ee4954
commit
91f65cedc8
2
gogs.go
2
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
|
||||
|
|
|
@ -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 @@
|
|||
0.11.18.0608
|
||||
0.11.19.0609
|
Loading…
Reference in New Issue