fix: pass down domain to comment for author URLs

This commit is contained in:
httpjamesm
2023-02-20 13:54:09 -05:00
parent d935ce72f6
commit f1370c29b6
4 changed files with 6 additions and 4 deletions

View File

@ -7,7 +7,7 @@ import (
"github.com/PuerkitoBio/goquery"
)
func FindAndReturnComments(inHtml string, postLayout *goquery.Selection) (comments []types.FilteredComment) {
func FindAndReturnComments(inHtml, domain string, postLayout *goquery.Selection) (comments []types.FilteredComment) {
commentsComponent := postLayout.Find("div.js-post-comments-component")
@ -54,6 +54,7 @@ func FindAndReturnComments(inHtml string, postLayout *goquery.Selection) (commen
AuthorName: commentAuthor.Text(),
AuthorURL: commentAuthorURL,
Upvotes: commentScore,
Domain: domain,
}
comments = append(comments, newFilteredComment)