Reworked fixers and NNTP output: now later does dehtmlifying, not fixers. They work with HTML data.

This commit is contained in:
2026-08-09 07:46:06 +05:00
parent 7b13dce342
commit dd0e1e9f4a
5 changed files with 22 additions and 29 deletions
+9 -3
View File
@@ -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
}