mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
all: Run modernize -fix ./...
This commit is contained in:
@@ -53,8 +53,8 @@ func (ns *Namespace) Sort(ctx context.Context, l any, args ...any) (any, error)
|
||||
collator := langs.GetCollator1(ns.deps.Conf.Language().(*langs.Language))
|
||||
|
||||
// Create a list of pairs that will be used to do the sort
|
||||
p := pairList{Collator: collator, sortComp: ns.sortComp, SortAsc: true, SliceType: sliceType}
|
||||
p.Pairs = make([]pair, seqv.Len())
|
||||
p := pairList{Collator: collator, sortComp: ns.sortComp, SortAsc: true, SliceType: sliceType,
|
||||
Pairs: make([]pair, seqv.Len())}
|
||||
|
||||
var sortByField string
|
||||
for i, l := range args {
|
||||
|
||||
@@ -18,6 +18,7 @@ import (
|
||||
"html"
|
||||
"html/template"
|
||||
"regexp"
|
||||
"slices"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
@@ -132,8 +133,8 @@ func (ns *Namespace) Truncate(s any, options ...any) (template.HTML, error) {
|
||||
out.WriteString(ellipsis)
|
||||
// Close out any open HTML tags
|
||||
var currentTag *htmlTag
|
||||
for i := len(tags) - 1; i >= 0; i-- {
|
||||
tag := tags[i]
|
||||
for _, tag := range slices.Backward(tags) {
|
||||
|
||||
if tag.pos >= endTextPos || currentTag != nil {
|
||||
if currentTag != nil && currentTag.name == tag.name {
|
||||
currentTag = nil
|
||||
|
||||
Reference in New Issue
Block a user