mirror of
https://gitgud.io/yats/libkiwi.git
synced 2026-06-27 22:45:21 -04:00
Even more refactoring n shit
This commit is contained in:
+7
-6
@@ -88,19 +88,20 @@ func parsePostAuthor(article *gq.Selection) (User, error) {
|
||||
|
||||
type Post struct {
|
||||
Author User
|
||||
Text []byte
|
||||
|
||||
HTML []byte
|
||||
|
||||
article *gq.Selection
|
||||
body *gq.Selection
|
||||
}
|
||||
|
||||
func (post *Post) TextContent() (io.Reader, error) {
|
||||
postHTML, err := post.body.Html()
|
||||
func (post *Post) TextContent() io.Reader {
|
||||
return strings.NewReader(strings.TrimSpace(post.body.Text()))
|
||||
}
|
||||
|
||||
func (post *Post) HTML() (io.Reader, error) {
|
||||
postHTML, err := post.article.Html()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return strings.NewReader(postHTML), nil
|
||||
return strings.NewReader(strings.TrimSpace(postHTML)), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user