From 6efb5b5d6fa84b90a660cfb85a99512eb02c44ec Mon Sep 17 00:00:00 2001 From: partisan Date: Mon, 9 Sep 2024 21:56:40 +0200 Subject: [PATCH] remove CDATA wrapper --- rss.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/rss.go b/rss.go index 7b20699..ab8b41d 100644 --- a/rss.go +++ b/rss.go @@ -30,9 +30,6 @@ func generateAtomFeed(w http.ResponseWriter, blogs []Blog, siteURL string) { // Ensure all image paths are absolute URLs (Idiot proofing) absoluteContent := strings.ReplaceAll(string(htmlContent), "src=\"/", fmt.Sprintf("src=\"%s/", siteURL)) - // Wrap HTML content in - cdataContent := fmt.Sprintf("", absoluteContent) - // Ensure unique and stable ID entryID := fmt.Sprintf("%s/%s/%d", siteURL, blog.Name, entry.Number) @@ -53,7 +50,7 @@ func generateAtomFeed(w http.ResponseWriter, blogs []Blog, siteURL string) { Author: &feeds.Author{Name: entry.Author}, Id: entryID, Updated: entry.Date, - Content: cdataContent, + Content: absoluteContent, }) } } @@ -88,9 +85,6 @@ func generateBlogAtomFeed(w http.ResponseWriter, blog Blog, siteURL string) { // Ensure all image paths are absolute URLs (Idiot proofing) absoluteContent := strings.ReplaceAll(string(htmlContent), "src=\"/", fmt.Sprintf("src=\"%s/", siteURL)) - // Wrap HTML content in - cdataContent := fmt.Sprintf("", absoluteContent) - // Ensure unique and stable ID entryID := fmt.Sprintf("%s/%s/%d", siteURL, blog.Name, entry.Number) @@ -111,7 +105,7 @@ func generateBlogAtomFeed(w http.ResponseWriter, blog Blog, siteURL string) { Author: &feeds.Author{Name: entry.Author}, Id: entryID, Updated: entry.Date, - Content: cdataContent, + Content: absoluteContent, }) }