tpl/tplimpl: Fix escaped HTML Go 1.9 multioutput issue (#3880)

Fixes #3876
This commit is contained in:
Bjørn Erik Pedersen
2017-09-13 12:32:06 +02:00
committed by GitHub
parent 642ba6cab2
commit 2d613dd905
3 changed files with 75 additions and 2 deletions

View File

@@ -305,7 +305,8 @@ func (t *htmlTemplates) addTemplateIn(tt *template.Template, name, tpl string) e
// We need to keep track of one ot the output format's shortcode template
// without knowing the rendering context.
withoutExt := strings.TrimSuffix(name, path.Ext(name))
tt.AddParseTree(withoutExt, templ.Tree)
clone := template.Must(templ.Clone())
tt.AddParseTree(withoutExt, clone.Tree)
}
return nil
@@ -334,7 +335,8 @@ func (t *textTemplates) addTemplateIn(tt *texttemplate.Template, name, tpl strin
// We need to keep track of one ot the output format's shortcode template
// without knowing the rendering context.
withoutExt := strings.TrimSuffix(name, path.Ext(name))
tt.AddParseTree(withoutExt, templ.Tree)
clone := texttemplate.Must(templ.Clone())
tt.AddParseTree(withoutExt, clone.Tree)
}
return nil