Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-02-26 12:42:21 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-02-26 23:54:36 +0300
commit10928a4f781c2faf704825ef95234125812ad860 (patch)
tree6d53312b301ad5259eb509fbdd13efa6c5c199e5 /tpl/strings
parentafd63bf7d56194a6aa5d32483151d71fa0b84f3a (diff)
Remove the trailing new line in .Code
Fixes #9572
Diffstat (limited to 'tpl/strings')
-rw-r--r--tpl/strings/strings.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/tpl/strings/strings.go b/tpl/strings/strings.go
index ac2defed5..2575b2fee 100644
--- a/tpl/strings/strings.go
+++ b/tpl/strings/strings.go
@@ -21,6 +21,7 @@ import (
"strings"
"unicode/utf8"
+ "github.com/gohugoio/hugo/common/text"
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/helpers"
@@ -119,7 +120,7 @@ func (ns *Namespace) Chomp(s interface{}) (interface{}, error) {
return "", err
}
- res := strings.TrimRight(ss, "\r\n")
+ res := text.Chomp(ss)
switch s.(type) {
case template.HTML:
return template.HTML(res), nil