From 69e326fb842e238c8440a10ea1284459e8e3d458 Mon Sep 17 00:00:00 2001 From: Samuel Johnson Date: Thu, 11 Dec 2025 03:52:13 -0500 Subject: Unescape HTML --- cmd/web/handlers/export.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/web/handlers/export.go b/cmd/web/handlers/export.go index bae5687..3f18a7f 100644 --- a/cmd/web/handlers/export.go +++ b/cmd/web/handlers/export.go @@ -1,6 +1,7 @@ package handlers import ( + "bytes" "database/sql" "encoding/xml" "log" @@ -104,5 +105,14 @@ func (ctx *rssExportContext) feed(w http.ResponseWriter, r *http.Request) { return } + // Really stupid workaround. + // Basically, encoders will escape HTML automatically. + // This can be configured on the JSON encoder. + // It cannot on the XML. + // God only knows why. + out = bytes.Replace(out, []byte("&"), []byte("&"), -1) + out = bytes.Replace(out, []byte(">"), []byte(">"), -1) + out = bytes.Replace(out, []byte("<"), []byte("<"), -1) + w.Write([]byte(xml.Header + `` + string(out) + ``)) } -- cgit v1.2.3