浏览代码

Merge pull request #2883 from nikkomiu/develop

Fixes #2842 Parses URL through EscapePound template function
Unknwon 9 年之前
父节点
当前提交
9dda9ef07c
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/template/template.go

+ 1 - 1
modules/template/template.go

@@ -97,7 +97,7 @@ func NewFuncMap() []template.FuncMap {
 		"ActionContent2Commits": ActionContent2Commits,
 		"ToUtf8":                ToUtf8,
 		"EscapePound": func(str string) string {
-			return strings.Replace(strings.Replace(str, "%", "%25", -1), "#", "%23", -1)
+			return strings.NewReplacer("%", "%25", "#", "%23", " ", "%20").Replace(str)
 		},
 		"RenderCommitMessage": RenderCommitMessage,
 		"ThemeColorMetaTag": func() string {