From 167c01530bb295c8b8d35921eb27ffa5bee76dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 10 Dec 2019 08:02:15 +0100 Subject: Create lightweight forks of text/template and html/template This commit also removes support for Ace and Amber templates. Updates #6594 --- output/layout_base.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'output') diff --git a/output/layout_base.go b/output/layout_base.go index b8930df82..772002e68 100644 --- a/output/layout_base.go +++ b/output/layout_base.go @@ -26,8 +26,7 @@ const ( ) var ( - aceTemplateInnerMarkers = [][]byte{[]byte("= content")} - goTemplateInnerMarkers = [][]byte{[]byte("{{define"), []byte("{{ define"), []byte("{{- define"), []byte("{{-define")} + goTemplateInnerMarkers = [][]byte{[]byte("{{define"), []byte("{{ define"), []byte("{{- define"), []byte("{{-define")} ) // TemplateNames represents a template naming scheme. @@ -110,8 +109,8 @@ func CreateTemplateNames(d TemplateLookupDescriptor) (TemplateNames, error) { id.Name = "_text/" + id.Name } - // Ace and Go templates may have both a base and inner template. - if ext == "amber" || isShorthCodeOrPartial(name) { + // Go templates may have both a base and inner template. + if isShorthCodeOrPartial(name) { // No base template support return id, nil } @@ -128,10 +127,6 @@ func CreateTemplateNames(d TemplateLookupDescriptor) (TemplateNames, error) { baseFilename = fmt.Sprintf("%s.%s", baseFileBase, ext) } - if ext == "ace" { - innerMarkers = aceTemplateInnerMarkers - } - // This may be a view that shouldn't have base template // Have to look inside it to make sure needsBase, err := d.ContainsAny(d.RelPath, innerMarkers) @@ -152,7 +147,7 @@ func CreateTemplateNames(d TemplateLookupDescriptor) (TemplateNames, error) { pathsToCheck := createPathsToCheck(pathDir, baseFilename, currBaseFilename) // We may have language code and/or "terms" in the template name. We want the most specific, - // but need to fall back to the baseof.html or baseof.ace if needed. + // but need to fall back to the baseof.html if needed. // E.g. list-baseof.en.html and list-baseof.terms.en.html // See #3893, #3856. baseBaseFilename, currBaseBaseFilename := helpers.Filename(baseFilename), helpers.Filename(currBaseFilename) -- cgit v1.2.3