Fix lint errors
This commit is contained in:
parent
fa68023ac2
commit
7276a2d651
3 changed files with 7 additions and 7 deletions
|
|
@ -5,7 +5,7 @@ import (
|
||||||
"unicode"
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SanitizeMessage removes Unicode control characters, format characters (RTL overrides,
|
// SanitizeMessageContent removes Unicode control characters, format characters (RTL overrides,
|
||||||
// zero-width characters), and other non-graphic characters that could confuse an LLM
|
// zero-width characters), and other non-graphic characters that could confuse an LLM
|
||||||
// or cause display issues in the agent UI.
|
// or cause display issues in the agent UI.
|
||||||
func SanitizeMessageContent(input string) string {
|
func SanitizeMessageContent(input string) string {
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ func TestSanitizeMessageContent(t *testing.T) {
|
||||||
{"strip RTL override", "Hi\u202eevil", "Hievil"},
|
{"strip RTL override", "Hi\u202eevil", "Hievil"},
|
||||||
{"strip BOM", "\uFEFFcontent", "content"},
|
{"strip BOM", "\uFEFFcontent", "content"},
|
||||||
{"strip multiple", "a\u200c\u202ab\u202cc", "abc"},
|
{"strip multiple", "a\u200c\u202ab\u202cc", "abc"},
|
||||||
{"unicode letters preserved", "café 日本語", "café 日本語"},
|
{"unicode letters preserved", "café \u65e5\u672c\u8a9e", "café \u65e5\u672c\u8a9e"},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
t.Run(tt.name, func(t *testing.T) {
|
t.Run(tt.name, func(t *testing.T) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue