diff --git a/main.go b/main.go
index a27bbd6..944a582 100644
--- a/main.go
+++ b/main.go
@@ -97,11 +97,17 @@ func main() {
})
answers := []template.HTML{}
+
doc.Find("div.answer").Each(func(i int, s *goquery.Selection) {
postLayout := s.Find("div.post-layout")
answerCell := postLayout.Find("div.answercell")
answerBody := answerCell.Find("div.s-prose")
answerBodyHTML, _ := answerBody.Html()
+ if s.HasClass("accepted-answer") {
+ // add
Accepted Answer
to the top of the answer
+ answerBodyHTML = `Accepted Answer
` + answerBodyHTML
+ }
+
answers = append(answers, template.HTML(answerBodyHTML))
})
diff --git a/public/question.css b/public/question.css
index 8cf82b2..d01810d 100644
--- a/public/question.css
+++ b/public/question.css
@@ -67,4 +67,17 @@ a {
border: 0;
height: 1px;
background-color: #42464e;
+}
+
+img {
+ max-width: 100%;
+}
+
+.accepted-answer {
+ background-color: #8cffc0;
+ border-radius: 5px;
+ padding: 1rem;
+ color: black;
+ margin-bottom: 1rem;
+ /* width: fit-content; */
}
\ No newline at end of file
diff --git a/templates/question.html b/templates/question.html
index 876c957..56660ba 100644
--- a/templates/question.html
+++ b/templates/question.html
@@ -3,6 +3,10 @@
{{ .title }}
+
@@ -19,8 +23,8 @@
Answers
{{ range $answer := .answers }}
-
{{ $answer }}
-
+
{{ $answer }}
+
{{ end }}