diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-26 10:42:21 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2022-02-26 21:54:36 +0100 |
commit | 10928a4f781c2faf704825ef95234125812ad860 (patch) | |
tree | 6d53312b301ad5259eb509fbdd13efa6c5c199e5 /tpl | |
parent | afd63bf7d56194a6aa5d32483151d71fa0b84f3a (diff) |
Remove the trailing new line in .Code
Fixes #9572
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/strings/strings.go | 3 |
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 |