hugolib: Add more summary test
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 28 Jun 2017 18:30:26 +0000 (20:30 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Wed, 28 Jun 2017 18:30:26 +0000 (20:30 +0200)
Closes #2973

hugolib/page_test.go

index 66fc5d2538b7c7a94335cb544084ced1fc90a6e7..88724cd1c74f08dd49de13657931ee5204b357da 100644 (file)
@@ -817,6 +817,29 @@ func TestPageWithMoreTagOnlySummary(t *testing.T) {
        testAllMarkdownEnginesForPages(t, assertFunc, nil, simplePageWithSummaryDelimiterOnlySummary)
 }
 
+// #2973
+func TestSummaryWithHTMLTagsOnNextLine(t *testing.T) {
+
+       assertFunc := func(t *testing.T, ext string, pages Pages) {
+               p := pages[0]
+               require.Contains(t, p.Summary, "Happy new year everyone!")
+               require.NotContains(t, p.Summary, "User interface")
+       }
+
+       testAllMarkdownEnginesForPages(t, assertFunc, nil, `---
+title: Simple
+---
+Happy new year everyone!
+
+Here is the last report for commits in the year 2016. It covers hrev50718-hrev50829.
+
+<!--more-->
+
+<h3>User interface</h3>
+
+`)
+}
+
 func TestPageWithDate(t *testing.T) {
        t.Parallel()
        cfg, fs := newTestCfg()