mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-21 21:35:28 +02:00
hugolib: Make RawContent raw again
This was a regression introduced in Hugo 0.17. Fixes #2601
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user