diff options
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/tplimpl/template.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tpl/tplimpl/template.go b/tpl/tplimpl/template.go index c1fad3068..f0d3066e2 100644 --- a/tpl/tplimpl/template.go +++ b/tpl/tplimpl/template.go @@ -252,12 +252,12 @@ func (t *htmlTemplates) LookupVariant(name string, variants tpl.TemplateVariants return t.handler.LookupVariant(name, variants) } -func (t *templateHandler) cloneTemplate(in interface{}) tpl.Template { +func (t *templateHandler) lookupTemplate(in interface{}) tpl.Template { switch templ := in.(type) { case *texttemplate.Template: - return texttemplate.Must(templ.Clone()) + return t.text.lookup(templ.Name()) case *template.Template: - return template.Must(templ.Clone()) + return t.html.lookup(templ.Name()) } panic(fmt.Sprintf("%T is not a template", in)) @@ -294,7 +294,7 @@ func (t *templateHandler) clone(d *deps.Deps) *templateHandler { variantsc[i] = shortcodeVariant{ info: variant.info, variants: variant.variants, - templ: t.cloneTemplate(variant.templ), + templ: c.lookupTemplate(variant.templ), } } other.variants = variantsc |