From 33445e5b681bbdffaf0925ed020ecdcc49687f15 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 11 Dec 2017 22:16:32 -0800 Subject: Add the possibility to define rewrite rules for each feed --- reader/json/json.go | 6 ++---- reader/json/parser_test.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'reader/json') diff --git a/reader/json/json.go b/reader/json/json.go index 3401232..da6df24 100644 --- a/reader/json/json.go +++ b/reader/json/json.go @@ -9,12 +9,10 @@ import ( "strings" "time" - "github.com/miniflux/miniflux2/reader/sanitizer" - "github.com/miniflux/miniflux2/helper" "github.com/miniflux/miniflux2/model" "github.com/miniflux/miniflux2/reader/date" - "github.com/miniflux/miniflux2/reader/processor" + "github.com/miniflux/miniflux2/reader/sanitizer" ) type jsonFeed struct { @@ -148,7 +146,7 @@ func (j *jsonItem) Transform() *model.Entry { entry.Date = j.GetDate() entry.Author = j.GetAuthor() entry.Hash = j.GetHash() - entry.Content = processor.ItemContentProcessor(entry.URL, j.GetContent()) + entry.Content = j.GetContent() entry.Title = strings.TrimSpace(j.GetTitle()) entry.Enclosures = j.GetEnclosures() return entry diff --git a/reader/json/parser_test.go b/reader/json/parser_test.go index dd680f8..60d7707 100644 --- a/reader/json/parser_test.go +++ b/reader/json/parser_test.go @@ -148,7 +148,7 @@ func TestParsePodcast(t *testing.T) { t.Errorf(`Incorrect entry title, got: "%s"`, feed.Entries[0].Title) } - if feed.Entries[0].Content != `Chris has worked at Adobe and as a founder of Rogue Sheep, which won an Apple Design Award for Postage. Chris’s new company is Aged & Distilled with Guy English — which shipped Napkin, a Mac app for visual collaboration. Chris is also the co-host of The Record. He lives on Bainbridge Island, a quick ferry ride from Seattle.` { + if feed.Entries[0].Content != `Chris has worked at Adobe and as a founder of Rogue Sheep, which won an Apple Design Award for Postage. Chris’s new company is Aged & Distilled with Guy English — which shipped Napkin, a Mac app for visual collaboration. Chris is also the co-host of The Record. He lives on Bainbridge Island, a quick ferry ride from Seattle.` { t.Errorf(`Incorrect entry content, got: "%s"`, feed.Entries[0].Content) } -- cgit v1.2.3