We are trying to get our RSS feeds in HUGO working and the problem we are running into is that all of our posts .md
files (we have a few thousand) have special chars in them like ’
And XML does not support character entities. So they need to be transformed before being inserted into our feeds.
What is the best way to output the {{ .Content }} as HTML with character entities decoded?
In the RSS feed template, I am trying
this just encodes everything
<content:encoded>{{ .Content | html }}</content:encoded>
this produces decent HTML but the entities are not transformed.
<content:encoded>{{ .Content | safeHTML }}</content:encoded>
not sure if I should be using CDATA ot not…
<content:encoded>{{chomp "<![CDATA[\n"}}{{ .Content | safeHTML }}{{chomp "]]>\n"}}</content:encoded>