mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-06 10:17:37 +02:00
Refactor "string truncate" (#32984)
This commit is contained in:
1 parent
594edad213
commit
9bfa9f450d
26 files changed
+199
-140
No files matched your search
@@ -109,7 +109,7 @@ func (a *actionNotifier) CreateIssueComment(ctx context.Context, doer *user_mode
|
||||
IsPrivate: issue.Repo.IsPrivate,
|
||||
}
|
||||
|
||||
truncatedContent, truncatedRight := util.SplitStringAtByteN(comment.Content, 200)
|
||||
truncatedContent, truncatedRight := util.EllipsisDisplayStringX(comment.Content, 200)
|
||||
if truncatedRight != "" {
|
||||
// in case the content is in a Latin family language, we remove the last broken word.
|
||||
lastSpaceIdx := strings.LastIndex(truncatedContent, " ")
|
||||
|
||||
Reference in new issue
Block a user