summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-24 14:05:37 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-04-24 15:35:04 +0200
commit33c738116c26e2ac37f4bd48159e8e3197fd7b39 (patch)
treecafcca99e66f0ce0d2686180e891f09c5bfc6cdd /hugolib/shortcode_test.go
parent69a56420aec5bf5abb846701d4a5ec67fe060d96 (diff)
hugolib: Fix shortcode version=1 logic
Fixes #5831
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r--hugolib/shortcode_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go
index ea56bf792..42eef61ae 100644
--- a/hugolib/shortcode_test.go
+++ b/hugolib/shortcode_test.go
@@ -531,6 +531,13 @@ tags:
**Tags:** {{< tags >}}`,
filepath.FromSlash("public/sect/doc11/index.html"),
"<p><strong>Tags:</strong> 2</p>\n"},
+ {"sect/doc12.md", `---
+title: "Foo"
+---
+
+{{% html-indented-v1 %}}`,
+ "public/sect/doc12/index.html",
+ "<h1>Hugo!</h1>"},
}
sources := make([][2]string, len(tests))
@@ -545,6 +552,9 @@ tags:
templ.AddTemplate("_internal/shortcodes/b.html", `b`)
templ.AddTemplate("_internal/shortcodes/c.html", `c`)
templ.AddTemplate("_internal/shortcodes/d.html", `d`)
+ templ.AddTemplate("_internal/shortcodes/html-indented-v1.html", "{{ $_hugo_config := `{ \"version\": 1 }` }}"+`
+ <h1>Hugo!</h1>
+`)
templ.AddTemplate("_internal/shortcodes/menu.html", `{{ len (index .Page.Menus "main").Children }}`)
templ.AddTemplate("_internal/shortcodes/tags.html", `{{ len .Page.Site.Taxonomies.tags }}`)
@@ -577,7 +587,7 @@ tags:
th := testHelper{s.Cfg, s.Fs, t}
expected := cast.ToStringSlice(test.expected)
- th.assertFileContent(test.outFile, expected...)
+ th.assertFileContent(filepath.FromSlash(test.outFile), expected...)
})
}