Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit eb5e7a8

Browse files
committed
避免乱码
1 parent 2af83a5 commit eb5e7a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

websites/code2/studygolang/src/logic/searcher.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func (self SearcherLogic) DoSearch(q, field string, start, rows int) (*model.Res
321321
if maxLen > searchContentLen {
322322
maxLen = searchContentLen
323323
}
324-
doc.HlContent = doc.Content[:maxLen]
324+
doc.HlContent = util.NewString(doc.Content).Slice(0, maxLen)
325325
}
326326

327327
doc.HlContent += "..."

0 commit comments

Comments
 (0)