Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve paragraphs in review text #2

Open
janwillies opened this issue May 10, 2023 · 0 comments
Open

Preserve paragraphs in review text #2

janwillies opened this issue May 10, 2023 · 0 comments

Comments

@janwillies
Copy link
Owner

janwillies commented May 10, 2023

This should probably be a map instead of a single string:

func (r *ReviewClient) getText() string {
var text string
r.Doc.Find("div#rezitext p").Each(func(i int, s *goquery.Selection) {
_, exists := s.Attr("class")
if !exists {
text += " " + s.Text()
}
})
return strings.TrimSpace(text)
}

To preserve at least some formatting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant