From 87fc54c9d41bdbe7eaa8769386776a3723580b34 Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Sun, 25 Jul 2021 17:35:41 -0700 Subject: showing post replies bug fix --- main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index f5b8613..17ed9d1 100644 --- a/main.go +++ b/main.go @@ -1737,7 +1737,7 @@ func CreateAttachmentObject(file multipart.File, header *multipart.FileHeader) ( func ParseCommentForReplies(db *sql.DB, comment string, op string) []ObjectBase { - re := regexp.MustCompile(`(>>https?://[A-Za-z0-9_.\-~]+\/[A-Za-z0-9_.\-~]+\/\w+)`) + re := regexp.MustCompile(`(>>(https?://[A-Za-z0-9_.:\-~]+\/[A-Za-z0-9_.\-~]+\/)(f[A-Za-z0-9_.\-~]+-)?([A-Za-z0-9_.\-~]+)?#?([A-Za-z0-9_.\-~]+)?)`) match := re.FindAllStringSubmatch(comment, -1) var links []string @@ -2410,9 +2410,9 @@ func UpdateObjectWithPreview(db *sql.DB, id string, preview string) { func ParseCommentForReply(comment string) string { - re := regexp.MustCompile("(>>)(https://|http://)?(www\\.)?.+\\/\\w+") + re := regexp.MustCompile(`(>>(https?://[A-Za-z0-9_.:\-~]+\/[A-Za-z0-9_.\-~]+\/)(f[A-Za-z0-9_.\-~]+-)?([A-Za-z0-9_.\-~]+)?#?([A-Za-z0-9_.\-~]+)?)`) match := re.FindAllStringSubmatch(comment, -1) - + var links []string for i:= 0; i < len(match); i++ { -- cgit v1.2.3