From 41b8939b0b3e173a0990f36155e098da29fcde45 Mon Sep 17 00:00:00 2001 From: xrdev Date: Sun, 3 Nov 2024 17:32:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E6=88=AA=E5=8F=96=E5=AF=BC=E8=87=B4=E4=B9=B1?= =?UTF-8?q?=E7=A0=81=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Plugins/webtitle.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/webtitle.go b/Plugins/webtitle.go index 49f2c48..7ec6a4a 100644 --- a/Plugins/webtitle.go +++ b/Plugins/webtitle.go @@ -210,8 +210,9 @@ func gettitle(body []byte) (title string) { title = strings.Replace(title, "\n", "", -1) title = strings.Replace(title, "\r", "", -1) title = strings.Replace(title, " ", " ", -1) - if len(title) > 100 { - title = title[:100] + titleRune := []rune(title) + if len(titleRune) > 5 { + title = string(titleRune[:100]) } if title == "" { title = "\"\"" //空格