hugolib: Make RawContent raw again

This was a regression introduced in Hugo 0.17.

Fixes #2601
This commit is contained in:
Bjørn Erik Pedersen
2016-12-01 10:21:49 +01:00
parent 971d1baf13
commit 2f026ab3f3
5 changed files with 53 additions and 22 deletions

View File

@@ -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) {