summaryrefslogtreecommitdiffstats
path: root/hugolib/page_test.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-12-01 10:21:49 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-12-01 17:29:49 +0100
commit2f026ab3f3866852794c4c9ceec834b54b0e0921 (patch)
tree8825b47eb53958ca925fdb0a2bb4254062d70e46 /hugolib/page_test.go
parent971d1baf1393c07081607bd62a87da545d9cb34e (diff)
hugolib: Make RawContent raw again
This was a regression introduced in Hugo 0.17. Fixes #2601
Diffstat (limited to 'hugolib/page_test.go')
-rw-r--r--hugolib/page_test.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/hugolib/page_test.go b/hugolib/page_test.go
index 70659f272..5dbff9707 100644
--- a/hugolib/page_test.go
+++ b/hugolib/page_test.go
@@ -753,6 +753,26 @@ func TestPageWithDelimiterForMarkdownThatCrossesBorder(t *testing.T) {
}
}
+// Issue #2601
+func TestPageRawContent(t *testing.T) {
+ s := newSiteFromSources("raw.md", `---
+title: Raw
+---
+**Raw**`)
+
+ writeSource(t, filepath.Join("layouts", "_default", "single.html"), `{{ .RawContent }}`)
+
+ if err := buildSiteSkipRender(s); err != nil {
+ t.Fatalf("Failed to build site: %s", err)
+ }
+
+ require.Len(t, s.RegularPages, 1)
+ p := s.RegularPages[0]
+
+ require.Contains(t, p.RawContent(), "**Raw**")
+
+}
+
func TestPageWithShortCodeInSummary(t *testing.T) {
assertFunc := func(t *testing.T, ext string, pages Pages) {