diff --git a/internal/reader/rewrite/rewrite_functions.go b/internal/reader/rewrite/rewrite_functions.go index 2125f8f0c7b..c16349553ce 100644 --- a/internal/reader/rewrite/rewrite_functions.go +++ b/internal/reader/rewrite/rewrite_functions.go @@ -27,7 +27,7 @@ var ( textLinkRegex = regexp.MustCompile(`(?mi)(\bhttps?:\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])`) ) -func addImageTitle(entryURL, entryContent string) string { +func addImageTitle(entryContent string) string { doc, err := goquery.NewDocumentFromReader(strings.NewReader(entryContent)) if err != nil { return entryContent @@ -51,7 +51,7 @@ func addImageTitle(entryURL, entryContent string) string { return entryContent } -func addMailtoSubject(entryURL, entryContent string) string { +func addMailtoSubject(entryContent string) string { doc, err := goquery.NewDocumentFromReader(strings.NewReader(entryContent)) if err != nil { return entryContent @@ -83,7 +83,7 @@ func addMailtoSubject(entryURL, entryContent string) string { return entryContent } -func addDynamicImage(entryURL, entryContent string) string { +func addDynamicImage(entryContent string) string { doc, err := goquery.NewDocumentFromReader(strings.NewReader(entryContent)) if err != nil { return entryContent @@ -167,7 +167,7 @@ func addDynamicImage(entryURL, entryContent string) string { return entryContent } -func addDynamicIframe(entryURL, entryContent string) string { +func addDynamicIframe(entryContent string) string { doc, err := goquery.NewDocumentFromReader(strings.NewReader(entryContent)) if err != nil { return entryContent @@ -204,7 +204,7 @@ func addDynamicIframe(entryURL, entryContent string) string { return entryContent } -func fixMediumImages(entryURL, entryContent string) string { +func fixMediumImages(entryContent string) string { doc, err := goquery.NewDocumentFromReader(strings.NewReader(entryContent)) if err != nil { return entryContent @@ -221,7 +221,7 @@ func fixMediumImages(entryURL, entryContent string) string { return output } -func useNoScriptImages(entryURL, entryContent string) string { +func useNoScriptImages(entryContent string) string { doc, err := goquery.NewDocumentFromReader(strings.NewReader(entryContent)) if err != nil { return entryContent diff --git a/internal/reader/rewrite/rewriter.go b/internal/reader/rewrite/rewriter.go index 8ce7dce0245..4f8ee9512c6 100644 --- a/internal/reader/rewrite/rewriter.go +++ b/internal/reader/rewrite/rewriter.go @@ -24,13 +24,13 @@ type rule struct { func (rule rule) applyRule(entryURL string, entry *model.Entry) { switch rule.name { case "add_image_title": - entry.Content = addImageTitle(entryURL, entry.Content) + entry.Content = addImageTitle(entry.Content) case "add_mailto_subject": - entry.Content = addMailtoSubject(entryURL, entry.Content) + entry.Content = addMailtoSubject(entry.Content) case "add_dynamic_image": - entry.Content = addDynamicImage(entryURL, entry.Content) + entry.Content = addDynamicImage(entry.Content) case "add_dynamic_iframe": - entry.Content = addDynamicIframe(entryURL, entry.Content) + entry.Content = addDynamicIframe(entry.Content) case "add_youtube_video": entry.Content = addYoutubeVideo(entryURL, entry.Content) case "add_invidious_video": @@ -46,9 +46,9 @@ func (rule rule) applyRule(entryURL string, entry *model.Entry) { case "convert_text_link", "convert_text_links": entry.Content = replaceTextLinks(entry.Content) case "fix_medium_images": - entry.Content = fixMediumImages(entryURL, entry.Content) + entry.Content = fixMediumImages(entry.Content) case "use_noscript_figure_images": - entry.Content = useNoScriptImages(entryURL, entry.Content) + entry.Content = useNoScriptImages(entry.Content) case "replace": // Format: replace("search-term"|"replace-term") if len(rule.args) >= 2 {