I don’t follow you - the implementation isn’t following the commonmark spec, and as a result hugo is producing RSS feeds which are being rejected by readers because they don’t like parsing unclosed IMG tags which are missing the closing />
This seems like a problem in Goldmark to me, and I’m wondering whether other people have noticed it.
RSS readers on the other hand are much less forgiving, and break!
It’s not browsers who are forgiving (in this case at least), they’re just accepting the norm. RSS just follow another norm, xml, with closing tags everywhere. so you’re right, goldmark issue. that a bit of regexp could solve, I think ?
I’m rebuilding a site by using Hugo, which I now love
As part of this, I’m producing an RSS feed so that people can subscribe to new posts on my site
RSS feed not working in RSS readers. Loading the feed up in Chrome gives specific errors to track down. The most recent errors have been objecting to <hr> because it wants <hr /> and now objecting to <img> because it wants <img />
It isn’t the XML bit of RSS which is the problem, it is the parsing of the CDATA content within the xml <content> tag.
It seems that the short term solution is to go back through about 100 posts and convert all image references to HTML rather than use markdown for it.
I suggest you wait for other people’s feedback before doing something that extreme…
But again, you should try rather rexexp your way out of these problems, in case it’s JUST a matter of (self)closing tags. Seems way less time-consuming (and error-prone) than injecting a heapload of html.
If the declaration at the beginning of your HTML file is <!DOCTYPE html>, you are telling the browser that you are feeding it HTML5, which doesn’t require forward slashes when closing void elements such as img and hr. In this case, with that declaration, the browser isn’t being forgiving… it’s doing what you told it do to.
If you want to generate XHTML instead of HTML, tell the renderer to generate XHTML.
But I am highly suspicious of your need to go this route. Although I’ve only tested a few RSS readers, I’ve never had a problem with HTML5 wrapped in CDATA tags.