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
+1 -12
View File
@@ -1,26 +1,15 @@
package fixers
import (
"log/slog"
"strings"
"github.com/mmcdole/gofeed"
"github.com/prodigeris/html2text"
)
func opennetFixer(item *gofeed.Item) (string, string) {
oldBody, err := html2text.FromString(item.Description, html2text.Options{
PrettyTables: true,
})
if err != nil {
slog.Error("Failed to de-HTMLify opennet body!", "error", err.Error())
return item.Title, item.Description
}
newBody := &strings.Builder{}
for line := range strings.Lines(oldBody) {
for line := range strings.Lines(item.Description) {
if strings.HasPrefix(line, "Источник") {
continue
}