Add trim and replace template functions

This commit is contained in:
Tom Helmer Hansen
2015-01-16 21:18:19 +01:00
committed by bep
parent 32d15d91fc
commit 871e811339
2 changed files with 12 additions and 0 deletions

View File

@@ -1237,6 +1237,8 @@ func init() {
"relref": RelRef,
"apply": Apply,
"chomp": Chomp,
"replace": func(a string, b string, c string) string { return strings.Replace(a, b, c, -1) },
"trim": func(a string, b string) string { return strings.Trim(a, b) },
}
chompRegexp = regexp.MustCompile("[\r\n]+$")