diff options
author | Alex Scerba <alex@scerba.org> | 2025-02-11 14:31:44 -0500 |
---|---|---|
committer | Alex Scerba <alex@scerba.org> | 2025-02-11 14:31:44 -0500 |
commit | 666704192c963c0a0fb0e7a8b7ddcba27b4fd86f (patch) | |
tree | 03a9868a2d6f112a11cd493a970ed32942bf308c /cmd | |
parent | 9811992f6d1ea7e2f08c419e071d44c58cf158ca (diff) |
Fix tabs to spaces and escape the title sequence
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/http/feed.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd/http/feed.go b/cmd/http/feed.go index f325caf..553b3b0 100644 --- a/cmd/http/feed.go +++ b/cmd/http/feed.go @@ -1,6 +1,7 @@ package main import ( + "html" "time" ) @@ -28,12 +29,12 @@ func generateFeed(domain string, p *Posts) []byte { for _, post := range p.Collection { entry := ` <entry> - <title>` + post.Title + `</title> + <title>` + html.EscapeString(post.Title) + `</title> <link href="https://` + domain + `/posts/` + post.File + `.html"/> <id>https://` + domain + `/posts/` + post.File + `</id> <published>` + post.Date + `T00:00:00.000Z</published> - <updated>` + post.Date + `T00:00:00.000Z</updated> - <summary>Blog post</summary>` + <updated>` + post.Date + `T00:00:00.000Z</updated> + <summary>Blog post</summary>` entry = entry + ` </entry>` feed = feed + entry |