diff options
author | FChannel <> | 2021-07-25 17:35:41 -0700 |
---|---|---|
committer | FChannel <> | 2021-07-25 17:35:41 -0700 |
commit | 87fc54c9d41bdbe7eaa8769386776a3723580b34 (patch) | |
tree | 208bef1d292eb7aa58b44c7389bd9ed47b61d1fd /main.go | |
parent | 6846150cb48d080112981633d6dddabef5ce4439 (diff) |
showing post replies bug fix
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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++ { |