parser/pageparser: Fix when only shortcode and then summary

Fixes #5464
This commit is contained in:
Bjørn Erik Pedersen
2018-11-24 17:06:26 +01:00
parent dcfeed35c6
commit 94ab125b27
4 changed files with 26 additions and 9 deletions

View File

@@ -1508,6 +1508,15 @@ title: "Hugo"
This is a {{< sc >}}.
<!--more-->
Content.
`)
// https://github.com/gohugoio/hugo/issues/5464
b.WithContent("page-md-only-shortcode.md", `---
title: "Hugo"
---
{{< sc >}}
<!--more-->
{{< sc >}}
`)
b.WithContent("page-md-shortcode-same-line.md", `---
@@ -1570,6 +1579,11 @@ CONTENT:{{ .Content }}
"SUMMARY:<p>Summary.</p>:END",
"CONTENT:<p>Summary.</p>\n\n<p>Content.\t</p>\n",
)
b.AssertFileContent("public/page-md-only-shortcode/index.html",
"SUMMARY:a shortcode:END",
"CONTENT:a shortcode\n\na shortcode\n",
)
}
// TODO(bep) this may be useful for other tests.