mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 13:37:20 +00:00
Improve user search display name (#29002)
I tripped over this strange method and I don't think we need that workaround to fix the value. old:  new:  --------- Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@ -11,14 +11,6 @@ import (
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
)
|
||||
|
||||
// RemoveUsernameParameterSuffix returns the username parameter without the (fullname) suffix - leaving just the username
|
||||
func RemoveUsernameParameterSuffix(name string) string {
|
||||
if index := strings.Index(name, " ("); index >= 0 {
|
||||
name = name[:index]
|
||||
}
|
||||
return name
|
||||
}
|
||||
|
||||
// SanitizeFlashErrorString will sanitize a flash error string
|
||||
func SanitizeFlashErrorString(x string) string {
|
||||
return strings.ReplaceAll(html.EscapeString(x), "\n", "<br>")
|
||||
|
Reference in New Issue
Block a user