From 0489fff340d6a8cbcd778bbe18e656f1ba093796 Mon Sep 17 00:00:00 2001 From: perennial Date: Sat, 21 Sep 2024 19:29:42 +1000 Subject: [PATCH] novel: fix staticcheck issues --- core/novel.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/novel.go b/core/novel.go index d22a558..07780d6 100644 --- a/core/novel.go +++ b/core/novel.go @@ -5,9 +5,10 @@ import ( "regexp" "time" + "net/http" + "codeberg.org/vnpower/pixivfe/v2/server/session" "github.com/goccy/go-json" - "net/http" ) type Novel struct { @@ -106,8 +107,8 @@ func GetNovelByID(r *http.Request, id string) (Novel, error) { } // Novel embedded illusts - re_r := regexp.MustCompile("\\[pixivimage:(\\d+.\\d+)\\]") - re_d := regexp.MustCompile("\\d+.\\d+") + re_r := regexp.MustCompile(`\[pixivimage:(\d+\.\d+)\]`) + re_d := regexp.MustCompile(`\d+\.\d+`) re_t := regexp.MustCompile(`\"original\":\"(.+?)\"`) novel.Content = re_r.ReplaceAllStringFunc(novel.Content, func(s string) string {