Closed Aias closed 3 years ago
A year has passed so I'm probably too late, but I noticed the | safe
in the <content>
snippet above.
It's opportunistic but can it be the culprit? Zach himself uses without | safe
:
same way like eleventy-base-blog
:
Please share the RSS template so we can troubleshoot (or if the issue has been solved since, let us know so we can close).
Escaping the content would likely work but I changed the default postHTML behavior to use XHTML single tags for better compatibility.
Fixes #12. Switches postHTML closingSingleTag to 'slash' to be better with XML output if the content isn’t escaped as `safe` (html entity encoded). Also adds `posthtmlRenderOptions` option to override if needed.
I'm using Eleventy to generate a blog with an Atom feed, basically an exact clone of https://github.com/11ty/eleventy-base-blog.
As part of
.eleventy.js
, I have configured markdown to add<br/>
tags for line breaks.I noticed that my feed wasn't working, and if I opened it directly in Chrome, I received an error:
Because the breaks in the resulting markup were not self-closing - they were rendered as
<br>
. So I addedxhtmlOut: true
to the options above, thinking this would solve the issue, and it does add the closing slashes to breaks in templates, but for some reason I was still missing them in myfeed.xml
. Finally, I realized that removing the htmlToAbsoluteUrls filter from the<content>
tags solved the issue, so somehow it's breaking things.I'm guessing this has to do with how posthtml is parsing the content. Not quite sure what to do about it, since I think it'd be extremely complicated to get it to match whatever xhtmlOut option I've specified in my markdown options.