Disabling Markdown footnote links in RSS but not elsewhere

Is there a way to disable Markdown footnote links in RSS but not elsewhere?

W3C Feed Validation Service, for Atom and RSS doesn’t like the footnote fragments in URLs:

line 167, column 9: description should not contain relative URL references: #fn:1

Note that I don’t want to disable footnotes entirely, just disable the links inserted for them that jump down to the definition, and back up.

How your code for between <description> looks like?

When I last time revisited my RSS file, I stopped using <![CDATA[some stuff]]> as this causing more issues (unsure why) and I sticked with

<description>{{ .Summary | html }}</description>

The interesting fact is that when running hugo locally provide different output than in production where minifying is involved etc. I noticed that when I fixed RSS locally, the valudator do not return any errors, but once published in productions, same file, and validator throw few.

I have:

<description>{{ printf "<![CDATA[%s]]>" $description | safeHTML }}</description>

I haven’t had any problems with it. I should point out that the issue isn’t with Hugo, it’s that the content produced by the Markdown renderer for footnotes isn’t valid according to the W3 validator.

I am unable to reproduce this as described.

git clone --single-branch -b hugo-forum-topic-46358 https://github.com/jmooring/hugo-testing hugo-forum-topic-46358
cd hugo-forum-topic-46358
hugo server

Then view the home page source (Ctrl +U), and copy/paste to https://validator.w3.org/nu/#textarea.

@jmooring See Feed Validator Results: https://willfaught.com/paige/rss.xml :

The page in question is Markdown Syntax Guide · Paige.

Site: https://github.com/willfaught/paige/tree/master/exampleSite

Module: GitHub - willfaught/paige: Powerful, pliable pixel perfection. An advanced Hugo theme.

Gotcha. Valid HTML, but not valid for an RSS feed.

I’d just include a summary in the RSS feed and be done with it.

That’s not an option in this case, unfortunately. The full page content is supposed to be in the feed.

I guess I can insert the full URL before the fragment in the post content by doing a search/replace.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.