diff --git a/getarticles.go b/getarticles.go index 8460603..e7a9b5a 100644 --- a/getarticles.go +++ b/getarticles.go @@ -221,15 +221,18 @@ func getArticles(feedURL string, max int, noExcerpt bool) (string, error) { } } - // To make the message look not so bloated we remove multiple newlines. - // Split the article description/content into fragments between newlines. - fragments := strings.Split(description, "\n") + // Remove lines only consisting of "> "; thank you reddit. + description = strings.Replace(description, "> \n", "", -1) + + // To make the message look not so bloated we remove double newlines. + // Split the article description/content into fragments between double newlines. + fragments := strings.Split(description, "\n\n") // Empty article description/content description = "" // Fill article description/content with the fragments separated by one newline. for _, line := range fragments { - // Only if the only content is not "> ", thank you reddit. - if line != "> " { + // Only if the only content is not empty. + if line != "" { description = description + line + "\n" } }