result.readingTime = (result.wordCount + 212) / 213
}
- if rendered.summary != "" {
+ if c.pi.hasSummaryDivider || rendered.summary != "" {
result.summary = rendered.summary
result.summaryTruncated = rendered.summaryTruncated
} else if cp.po.p.m.pageConfig.Summary != "" {
<!--more-->
Some more text
+`
+
+ simplePageWithBlankSummary = `---
+title: SimpleWithBlankSummary
+---
+
+<!--more-->
+
+Some text.
`
simplePageWithSummaryParameter = `---
return expected
case "rst":
+ if str == "" {
+ return "<div class=\"document\"></div>"
+ }
return fmt.Sprintf("<div class=\"document\">\n\n\n%s</div>", str)
}
}
testAllMarkdownEnginesForPages(t, assertFunc, nil, simplePageWithSummaryDelimiter)
}
+func TestPageWithBlankSummary(t *testing.T) {
+ t.Parallel()
+ assertFunc := func(t *testing.T, ext string, pages page.Pages) {
+ p := pages[0]
+ checkPageTitle(t, p, "SimpleWithBlankSummary")
+ checkPageContent(t, p, normalizeExpected(ext, "<p>Some text.</p>\n"), ext)
+ checkPageSummary(t, p, normalizeExpected(ext, ""), ext)
+ checkPageType(t, p, "page")
+ }
+
+ testAllMarkdownEnginesForPages(t, assertFunc, nil, simplePageWithBlankSummary)
+}
+
func TestPageWithSummaryParameter(t *testing.T) {
t.Parallel()
assertFunc := func(t *testing.T, ext string, pages page.Pages) {