diff options
author | Unknwon <u@gogs.io> | 2016-12-21 04:08:23 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-12-21 04:08:23 -0500 |
commit | 67380cf47b6dfd6ff9999acc73dd7da8f620948f (patch) | |
tree | 48ff5c4f243346df3cb784f52b8021d417b1787a /modules/template/template.go | |
parent | 39fdb0f9c4f1668b47ff43665d525608a87fb0e6 (diff) |
Minor code fix
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", |