Reworked fixers and NNTP output: now later does dehtmlifying, not fixers. They work with HTML data.
This commit is contained in:
+9
-3
@@ -12,9 +12,15 @@ var fixers = map[string]fixerFunc{
|
||||
// Fix fixes title and body depending on site parsed.
|
||||
func Fix(domain string, feedItem *gofeed.Item) (string, string) {
|
||||
fixer, found := fixers[domain]
|
||||
if !found {
|
||||
return feedItem.Title, feedItem.Description
|
||||
if found {
|
||||
return fixer(feedItem)
|
||||
}
|
||||
|
||||
return fixer(feedItem)
|
||||
// We should check WHAT IS LONGER - description or content.
|
||||
bodyData := feedItem.Description
|
||||
if len(feedItem.Content) > len(feedItem.Description) {
|
||||
bodyData = feedItem.Content
|
||||
}
|
||||
|
||||
return feedItem.Title, bodyData
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user