Reworked fixers and NNTP output: now later does dehtmlifying, not fixers. They work with HTML data.
This commit is contained in:
+1
-13
@@ -1,21 +1,9 @@
|
||||
package fixers
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
|
||||
"github.com/mmcdole/gofeed"
|
||||
"github.com/prodigeris/html2text"
|
||||
)
|
||||
|
||||
func githubFixer(item *gofeed.Item) (string, string) {
|
||||
plainTextBody, err := html2text.FromString(item.Content, html2text.Options{
|
||||
PrettyTables: true,
|
||||
})
|
||||
if err != nil {
|
||||
slog.Error("Failed to de-HTMLify github body!", "error", err.Error())
|
||||
|
||||
return item.Title, item.Content
|
||||
}
|
||||
|
||||
return item.Title, plainTextBody
|
||||
return item.Title, item.Content
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user