RSS .MediaType.Type not working as it should?

Hi. I’m having trouble with getting the .Media.Type from RSS as alternative Output. I’m running the latest extended Hugo version on Windows. My code:

{{ range .AlternativeOutputFormats }}
    {{ .MediaType.Type }}
    <link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">  --> 
{{ end }}

The result is:

<link rel="alternate" type="application/rss&#43;xml" href="//localhost:1313/index.xml">

So the &#43; is not translating to a +. I tried the following:

{{ range .AlternativeOutputFormats }}
	{{ htmlUnescape .MediaType.Type | safeHTML }}
	<link rel="{{ .Rel }}" type="{{ htmlUnescape .MediaType.Type | safeHTML }}" href="{{ .Permalink | safeURL }}">
{{ end }}

Not I get a better result:

<link rel="alternate" type="application/rss&#43;xml" href="//localhost:1313/de/index.xml">

However, as you can see, the Unicode dezimal only gets translated if it is not within any html tags.

I don’t know if this is intended? Any solution to get the type to display properly?

See the template example in docs:

1 Like

Well that was obvious. Thanks. Got my code from the atlas boilerplate so I expected it to be proper…