Revert "tpl: Rework to handle both text and HTML templates"

Will have to take another stab at this ...

This reverts commit 5c5efa03d2.

Closes #3260
This commit is contained in:
Bjørn Erik Pedersen
2017-04-02 14:20:34 +02:00
parent c97dae40d9
commit 7eb71ee064
31 changed files with 839 additions and 1248 deletions

View File

@@ -115,13 +115,13 @@ F3: {{ Echo (printf "themes/%s-theme" .Site.Params.LOWER) }}
func TestParamsKeysToLower(t *testing.T) {
t.Parallel()
require.Error(t, applyTemplateTransformers(nil, nil))
require.Error(t, applyTemplateTransformers(nil))
templ, err := template.New("foo").Funcs(testFuncs).Parse(paramsTempl)
require.NoError(t, err)
c := newTemplateContext(createParseTreeLookup(templ))
c := newTemplateContext(templ)
require.Equal(t, -1, c.decl.indexOfReplacementStart([]string{}))
@@ -185,7 +185,7 @@ func BenchmarkTemplateParamsKeysToLower(b *testing.B) {
b.ResetTimer()
for i := 0; i < b.N; i++ {
c := newTemplateContext(createParseTreeLookup(templates[i]))
c := newTemplateContext(templates[i])
c.paramsKeysToLower(templ.Tree.Root)
}
}
@@ -214,7 +214,7 @@ Blue: {{ $__amber_1.Blue}}
require.NoError(t, err)
c := newTemplateContext(createParseTreeLookup(templ))
c := newTemplateContext(templ)
c.paramsKeysToLower(templ.Tree.Root)
@@ -254,7 +254,7 @@ P2: {{ .Params.LOWER }}
require.NoError(t, err)
overlayTpl = overlayTpl.Lookup(overlayTpl.Name())
c := newTemplateContext(createParseTreeLookup(overlayTpl))
c := newTemplateContext(overlayTpl)
c.paramsKeysToLower(overlayTpl.Tree.Root)
@@ -284,7 +284,7 @@ func TestTransformRecursiveTemplate(t *testing.T) {
templ, err := template.New("foo").Parse(recursive)
require.NoError(t, err)
c := newTemplateContext(createParseTreeLookup(templ))
c := newTemplateContext(templ)
c.paramsKeysToLower(templ.Tree.Root)
}