mirror of
https://github.com/httpjamesm/AnonymousOverflow.git
synced 2025-05-14 05:52:54 +00:00
feat: get answer ID and fragment scrolling
This commit is contained in:
parent
6bfed5a9e3
commit
cc9e549aaf
4 changed files with 11 additions and 1 deletions
|
@ -196,6 +196,7 @@ func ViewQuestion(c *gin.Context) {
|
|||
answers := []types.FilteredAnswer{}
|
||||
|
||||
doc.Find("div.answer").Each(func(i int, s *goquery.Selection) {
|
||||
|
||||
newFilteredAnswer := types.FilteredAnswer{}
|
||||
|
||||
postLayout := s.Find("div.post-layout")
|
||||
|
@ -235,6 +236,9 @@ func ViewQuestion(c *gin.Context) {
|
|||
answerTimestamp = html.EscapeString(s.Find("span.relativetime").Text())
|
||||
})
|
||||
|
||||
answerId, _ := s.Attr("data-answerid")
|
||||
newFilteredAnswer.ID = answerId
|
||||
|
||||
newFilteredAnswer.AuthorName = answerAuthorName
|
||||
newFilteredAnswer.AuthorURL = answerAuthorURL
|
||||
newFilteredAnswer.Timestamp = answerTimestamp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue