diff options
Diffstat (limited to 'tpl/transform')
-rw-r--r-- | tpl/transform/transform.go | 3 | ||||
-rw-r--r-- | tpl/transform/transform_test.go | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tpl/transform/transform.go b/tpl/transform/transform.go index 8d404f5a7..f1ffa77ae 100644 --- a/tpl/transform/transform.go +++ b/tpl/transform/transform.go @@ -55,7 +55,8 @@ func (ns *Namespace) Highlight(s interface{}, lang, opts string) (template.HTML, return "", err } - return template.HTML(helpers.Highlight(ns.deps.Cfg, html.UnescapeString(ss), lang, opts)), nil + highlighted, _ := ns.deps.ContentSpec.Highlight(html.UnescapeString(ss), lang, opts) + return template.HTML(highlighted), nil } // HTMLEscape returns a copy of s with reserved HTML characters escaped. diff --git a/tpl/transform/transform_test.go b/tpl/transform/transform_test.go index 5fb80c236..429b206fd 100644 --- a/tpl/transform/transform_test.go +++ b/tpl/transform/transform_test.go @@ -226,9 +226,14 @@ func TestPlainify(t *testing.T) { func newDeps(cfg config.Provider) *deps.Deps { l := helpers.NewLanguage("en", cfg) l.Set("i18nDir", "i18n") + cs, err := helpers.NewContentSpec(l) + if err != nil { + panic(err) + } + return &deps.Deps{ Cfg: cfg, Fs: hugofs.NewMem(l), - ContentSpec: helpers.NewContentSpec(l), + ContentSpec: cs, } } |