mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
parser/pageparser: Fix when only shortcode and then summary
Fixes #5464
This commit is contained in:
@@ -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.
|
||||
|
Reference in New Issue
Block a user