From a6a01fd7f2f94d6866498bfe9dfbba60a57ec0e5 Mon Sep 17 00:00:00 2001 From: John Date: Sat, 21 Mar 2020 23:42:34 +0800 Subject: [PATCH] improve template cache for ParseContent function of package gview --- os/gview/gview_parse.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/gview/gview_parse.go b/os/gview/gview_parse.go index 8e1693963..19f7b1c9b 100644 --- a/os/gview/gview_parse.go +++ b/os/gview/gview_parse.go @@ -174,7 +174,7 @@ func (view *View) ParseContent(content string, params ...Params) (string, error) return "", nil } err := (error)(nil) - key := fmt.Sprintf("%s_%v", gCONTENT_TEMPLATE_NAME, view.delimiters) + key := fmt.Sprintf("%s_%v_%v", gCONTENT_TEMPLATE_NAME, view.delimiters, view.config.AutoEncode) tpl := templates.GetOrSetFuncLock(key, func() interface{} { if view.config.AutoEncode { return htmltpl.New(gCONTENT_TEMPLATE_NAME).Delims(view.delimiters[0], view.delimiters[1]).Funcs(view.funcMap)