Refactor "string truncate" (#32984)

This commit is contained in:
wxiaoguang 2024-12-26 11:56:03 +08:00 committed by GitHub
parent 594edad213
commit 9bfa9f450d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 199 additions and 140 deletions

View file

@ -8,7 +8,7 @@ import (
"html/template"
"strings"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/util"
)
type StringUtils struct{}
@ -54,7 +54,7 @@ func (su *StringUtils) Cut(s, sep string) []any {
}
func (su *StringUtils) EllipsisString(s string, maxLength int) string {
return base.EllipsisString(s, maxLength)
return util.EllipsisDisplayString(s, maxLength)
}
func (su *StringUtils) ToUpper(s string) string {