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

@ -109,7 +109,7 @@ func unmarshal(filename string, content []byte) (*api.IssueTemplate, error) {
it.Content = string(content)
it.Name = path.Base(it.FileName) // paths in Git are always '/' separated - do not use filepath!
it.About, _ = util.SplitStringAtByteN(it.Content, 80)
it.About = util.EllipsisDisplayString(it.Content, 80)
} else {
it.Content = templateBody
if it.About == "" {