mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Refactor "string truncate" (#32984)
This commit is contained in:
@ -664,7 +664,7 @@ func PrepareCompareDiff(
|
||||
}
|
||||
if len(title) > 255 {
|
||||
var trailer string
|
||||
title, trailer = util.SplitStringAtByteN(title, 255)
|
||||
title, trailer = util.EllipsisDisplayStringX(title, 255)
|
||||
if len(trailer) > 0 {
|
||||
if ctx.Data["content"] != nil {
|
||||
ctx.Data["content"] = fmt.Sprintf("%s\n\n%s", trailer, ctx.Data["content"])
|
||||
|
Reference in New Issue
Block a user