I’ve recently moved to using hugo, and loving it, but I just went to switch my RSS feed from only summaries to providing full content, and suddenly had validation errors.
It seems like the template result of {{ .Content | transform.XMLEscape | safeHTML }}
includes the >
characters, as well as \n
— although the documentation for transform.XMLEscape says they should be replaced. And of course, if I remove safeHTML, then there’s double-escaping.
Just for fun I tried transform.HTMLEscape instead, and it still leaves in the >
characters.
Could this be a bug in XMLEscape & HTMLEscape? Or is there something I should check in my config, content, or RSS template?
Happy to share code, but not sure where to start. The current RSS feed is live on my site … and it’s “valid” but with warnings, relating to the included characters. Oddly, the .Summary
version of the feed (without full content) still has the >
characters, but the validator throws no warnings.
I’m using hugo v0.125.5-c8b9f9f81c375f5b391e61bae711ee63fc76c1fd+extended linux/amd64 BuildDate=2024-05-01T15:22:11Z VendorInfo=gohugoio
and I tried going back as early as 0.123.0 with the same results.