Don't post empty articles.

This commit is contained in:
Martin Dosch 2020-06-30 16:02:55 +02:00
parent d3f1b75d17
commit 5c629fe1cd

View file

@ -211,6 +211,12 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) {
return "", err return "", err
} }
// If the content is empty after html2text (e.g. consisting of an image only)
// then stop processing
if strings.Replace(mastodonContent, " ", "", -1) == "" {
continue
}
output = output + mastodonContent + "\n\n" + cleanURL output = output + mastodonContent + "\n\n" + cleanURL
if i > 0 { if i > 0 {