diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-12-26 11:56:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-26 11:56:03 +0800 |
commit | 9bfa9f450da509bf61c6c762bcb1dc1d6c9bd0bd (patch) | |
tree | 559615153f1580e4f63cc51a99db419ec06b74e3 /routers/web/repo | |
parent | 594edad213c2963edfdb6582663a9396ad43a9c0 (diff) | |
download | gitea-9bfa9f450da509bf61c6c762bcb1dc1d6c9bd0bd.tar.gz gitea-9bfa9f450da509bf61c6c762bcb1dc1d6c9bd0bd.zip |
Refactor "string truncate" (#32984)
Diffstat (limited to 'routers/web/repo')
-rw-r--r-- | routers/web/repo/compare.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 8c4003690a..b3c1eb7cb0 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -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"]) |