aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader/json
diff options
context:
space:
mode:
authorGravatar Frédéric Guillot <fred@miniflux.net>2017-12-11 22:16:32 -0800
committerGravatar Frédéric Guillot <fred@miniflux.net>2017-12-11 22:16:32 -0800
commit33445e5b681bbdffaf0925ed020ecdcc49687f15 (patch)
tree4c82a43cd84e57823c0c570a00380b4eb8f8390b /reader/json
parent87ccad5c7f1edf8bce37af547ca1659326398fa8 (diff)
Add the possibility to define rewrite rules for each feed
Diffstat (limited to 'reader/json')
-rw-r--r--reader/json/json.go6
-rw-r--r--reader/json/parser_test.go2
2 files changed, 3 insertions, 5 deletions
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 <a href="http://adobe.com/" rel="noopener noreferrer" target="_blank" referrerpolicy="no-referrer">Adobe</a> and as a founder of Rogue Sheep, which won an Apple Design Award for Postage. Chris’s new company is Aged &amp; Distilled with Guy English — which shipped <a href="http://aged-and-distilled.com/napkin/" rel="noopener noreferrer" target="_blank" referrerpolicy="no-referrer">Napkin</a>, a Mac app for visual collaboration. Chris is also the co-host of The Record. He lives on <a href="http://www.ci.bainbridge-isl.wa.us/" rel="noopener noreferrer" target="_blank" referrerpolicy="no-referrer">Bainbridge Island</a>, a quick ferry ride from Seattle.` {
+ if feed.Entries[0].Content != `Chris has worked at <a href="http://adobe.com/">Adobe</a> 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 <a href="http://aged-and-distilled.com/napkin/">Napkin</a>, a Mac app for visual collaboration. Chris is also the co-host of The Record. He lives on <a href="http://www.ci.bainbridge-isl.wa.us/">Bainbridge Island</a>, a quick ferry ride from Seattle.` {
t.Errorf(`Incorrect entry content, got: "%s"`, feed.Entries[0].Content)
}