}
func testAllMarkdownEnginesForPages(t *testing.T,
- assertFunc func(t *testing.T, ext string, pages page.Pages), settings map[string]any, pageSources ...string) {
-
+ assertFunc func(t *testing.T, ext string, pages page.Pages), settings map[string]any, pageSources ...string,
+) {
engines := []struct {
ext string
shouldExecute func() bool
}
func TestPageRawContent(t *testing.T) {
-
files := `
-- hugo.toml --
-- content/basic.md --
b.AssertFileContent("public/basic/index.html", "|**basic**|")
b.AssertFileContent("public/empty/index.html", "! title")
-
}
func TestPageWithShortCodeInSummary(t *testing.T) {
).BuildE()
b.Assert(err, qt.IsNotNil)
-
}
import (
"context"
+ "errors"
"fmt"
- "html/template"
"math/rand"
"net/url"
"reflect"
"strings"
"time"
- "errors"
-
"github.com/gohugoio/hugo/common/collections"
"github.com/gohugoio/hugo/common/hugo"
"github.com/gohugoio/hugo/common/maps"
// Delimit takes a given list l and returns a string delimited by sep.
// If last is passed to the function, it will be used as the final delimiter.
-func (ns *Namespace) Delimit(ctx context.Context, l, sep any, last ...any) (template.HTML, error) {
+func (ns *Namespace) Delimit(ctx context.Context, l, sep any, last ...any) (string, error) {
d, err := cast.ToStringE(sep)
if err != nil {
return "", err
return "", fmt.Errorf("can't iterate over %v", l)
}
- return template.HTML(str), nil
+ return str, nil
}
// Dictionary creates a new map from the given parameters by
}
}
-type tstGrouper struct {
-}
+type tstGrouper struct{}
type tstGroupers []*tstGrouper
return fmt.Sprintf("%v(%d)", key, ilen), nil
}
-type tstGrouper2 struct {
-}
+type tstGrouper2 struct{}
func (g *tstGrouper2) Group(key any, items any) (any, error) {
ilen := reflect.ValueOf(items).Len()
seq any
delimiter any
last any
- expect template.HTML
+ expect string
}{
{[]string{"class1", "class2", "class3"}, " ", nil, "class1 class2 class3"},
{[]int{1, 2, 3, 4, 5}, ",", nil, "1,2,3,4,5"},
} {
errMsg := qt.Commentf("[%d] %v", i, test)
- var result template.HTML
+ var result string
var err error
if test.last == nil {