Skip to content

Twitter og:description doubly escaped by Hugo 0.125.x #12418

@chalin

Description

@chalin

If you build this small repro (test-site-2024-04-23.zip) using Hugo 0.124.1 and 0.125.2, you'll see the following difference in the content of <meta property="og:description"> for http://localhost:1313/docs/page:

0.124.1: <meta property="og:description" content="Test line with a single quote: can&rsquo;t." />
0.125.2: <meta property="og:description" content="Test line with a single quote: can&amp;rsquo;t.">

Notice that 0.125.2 doubly escapes the content, so that:

  • can&rsquo;t becomes
  • can&amp;rsquo;t

This seems wrong to me. WDYT?


Below I include a bit more header context.

Hugo 0.124.1:

<meta name="description" content="Test line with a single quote: can&amp;rsquo;t.">
<meta property="og:title" content="Some page" />
<meta property="og:description" content="Test line with a single quote: can&rsquo;t." />
...
<meta name="twitter:description" content="Test line with a single quote: can&rsquo;t."/>

Hugo 0.125.2:

<meta name="description" content="Test line with a single quote: can&amp;rsquo;t.">
<meta property="og:url" content="http://localhost:1313/docs/page/">
  <meta property="og:site_name" content="My New Hugo Site">
  <meta property="og:title" content="Some page">
  <meta property="og:description" content="Test line with a single quote: can&amp;rsquo;t.">
  ...
<meta name="twitter:description" content="Test line with a single quote: can&rsquo;t.">

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions