Skip to content

[BUG] rss+xml in <head><link> is encoded into rss&#43;xml #392

@JannikArndt

Description

@JannikArndt

Describe the bug

The <link> tag gets a "safe url" encoding:

<link rel="alternate" type="application/rss&#43;xml" href="/index.xml">
  • Device/Os: MacOS 11.3
  • Hugo Version [ >=0.82.0 expected]: hugo v0.82.1+extended darwin/amd64 BuildDate=unknown
  • Theme Version [e.g. v4.0, master, or commit-id ]: master

Steps to reproduce the behavior:

Works on master:

$ git clone https://github.com/adityatelange/hugo-PaperMod.git
…
$ cd hugo-PaperMod
$ hugo
…
$ tail -n +20 public/index.html | head -n 5 

gives you

<meta name="msapplication-TileColor" content="#2e2e33">
<meta name="generator" content="Hugo 0.82.1" />
<link rel="alternate" type="application/rss&#43;xml" href="/index.xml">
<meta property="og:title" content="" />
<meta property="og:description" content="" />

Expected behavior:

It should be

<link rel="alternate" type="application/rss&+xml" href="/index.xml">

Additional context

The implementation is exactly as specified in the docs:

Potential fix

This does work on

<atom:link href="/categories/index.xml" rel="self" type="application/rss+xml" />

which is generated differently.
The same can be done in head.html with

{{ printf "<link rel=%q type=%q href=%q>" .Rel .MediaType .Permalink | safeHTML }}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions