aboutsummaryrefslogtreecommitdiff
path: root/internal/feed/mail.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-07 23:32:34 +0200
committerRené 'Necoro' Neumann <necoro@necoro.eu>2020-05-07 23:32:34 +0200
commit0532548c8abf170aaf0abddab67561d2c499863a (patch)
treeefdfecae6aca97724f9e06952b451428f053b307 /internal/feed/mail.go
parent432e26e4177cf351953ac97474326a2f439beba5 (diff)
downloadfeed2imap-go-0532548c8abf170aaf0abddab67561d2c499863a.tar.gz
feed2imap-go-0532548c8abf170aaf0abddab67561d2c499863a.tar.bz2
feed2imap-go-0532548c8abf170aaf0abddab67561d2c499863a.zip
Improve html rendering
Diffstat (limited to '')
-rw-r--r--internal/feed/mail.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/internal/feed/mail.go b/internal/feed/mail.go
index f77987e..ecd21ef 100644
--- a/internal/feed/mail.go
+++ b/internal/feed/mail.go
@@ -16,7 +16,6 @@ import (
"github.com/emersion/go-message"
"github.com/emersion/go-message/mail"
"github.com/gabriel-vasile/mimetype"
- "golang.org/x/net/html"
"github.com/Necoro/feed2imap-go/internal/feed/template"
"github.com/Necoro/feed2imap-go/internal/http"
@@ -241,13 +240,6 @@ func getBody(content, description string, bodyCfg config.Body) string {
}
}
-func startsWithText(str string) bool {
- reader := strings.NewReader(str)
- tokenizer := html.NewTokenizerFragment(reader, "")
-
- return tokenizer.Next() == html.TextToken
-}
-
func (item *item) buildBody() {
feed := item.feed
feedUrl, err := url.Parse(feed.Url)
@@ -256,9 +248,6 @@ func (item *item) buildBody() {
}
body := getBody(item.Content, item.Description, feed.Body)
- if body != "" && startsWithText(body) {
- body = "<br />" + body
- }
if !feed.InclImages {
item.Body = body