From c38b62c82a34560352fd27bfe29fe492757a8349 Mon Sep 17 00:00:00 2001 From: xing Date: Sun, 24 Dec 2023 00:20:35 +0800 Subject: [PATCH] fix bug --- app/plugins/pagination.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/plugins/pagination.go b/app/plugins/pagination.go index 3584ea1..7f32f19 100644 --- a/app/plugins/pagination.go +++ b/app/plugins/pagination.go @@ -95,12 +95,13 @@ func (p CommentPageEle) Urls(u url.URL, page int, isTLS bool) string { if !strings.Contains(path, "/comment-page-") { path = fmt.Sprintf("%s%s", path, "/comment-page-1#comments") } - path = commentReg.ReplaceAllString(path, fmt.Sprintf("/comment-page-%d#comments", page)) + path = commentReg.ReplaceAllString(path, fmt.Sprintf("/comment-page-%d", page)) path = strings.Replace(path, "//", "/", -1) - if path == "" { - path = "/" + ur := str.Join(path, query) + if !strings.Contains(ur, "#comments") { + ur = str.Join(ur, "#comments") } - return str.Join(path, query) + return ur } func (p CommentPageEle) Middle(page int, url string) string {