Browse Source

pkg/template: fix NewLine2br return type to string

pull/5254/merge
Unknwon 7 years ago
parent
commit
e25fe22f9d
No known key found for this signature in database
GPG Key ID: 7A02C406FAC875A2
  1. 2
      gogs.go
  2. 6
      pkg/template/template.go
  3. 2
      templates/.VERSION

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogs/gogs/pkg/setting" "github.com/gogs/gogs/pkg/setting"
) )
const APP_VER = "0.11.50.0530" const APP_VER = "0.11.51.0602"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

6
pkg/template/template.go

@ -131,9 +131,9 @@ func Str2html(raw string) template.HTML {
return template.HTML(markup.Sanitize(raw)) return template.HTML(markup.Sanitize(raw))
} }
// Simple filter, converts newline symbols to <br> // NewLine2br simply replaces "\n" to "<br>".
func NewLine2br(raw string) template.HTML { func NewLine2br(raw string) string {
return template.HTML(strings.Replace(raw, "\n", "<br>", -1)) return strings.Replace(raw, "\n", "<br>", -1)
} }
func List(l *list.List) chan interface{} { func List(l *list.List) chan interface{} {

2
templates/.VERSION

@ -1 +1 @@
0.11.50.0530 0.11.51.0602
Loading…
Cancel
Save