diff options
Diffstat (limited to 'modules/template/template.go')
-rw-r--r-- | modules/template/template.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/modules/template/template.go b/modules/template/template.go index f005d5ce..ac91bb76 100644 --- a/modules/template/template.go +++ b/modules/template/template.go @@ -96,10 +96,8 @@ func NewFuncMap() []template.FuncMap { "ShortSha": base.ShortSha, "MD5": base.EncodeMD5, "ActionContent2Commits": ActionContent2Commits, - "EscapePound": func(str string) string { - return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(str) - }, - "RenderCommitMessage": RenderCommitMessage, + "EscapePound": EscapePound, + "RenderCommitMessage": RenderCommitMessage, "ThemeColorMetaTag": func() string { return setting.UI.ThemeColorMetaTag }, @@ -268,6 +266,10 @@ func ActionContent2Commits(act Actioner) *models.PushCommits { return push } +func EscapePound(str string) string { + return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20", "?", "%3F").Replace(str) +} + func DiffTypeToStr(diffType int) string { diffTypes := map[int]string{ 1: "add", 2: "modify", 3: "del", 4: "rename", |