text.double-escaped

Card text is escaped twice. Level: Warning.

When it is raised

Raised when the value used for og:title, og:description, og:site_name or og:image:alt, already decoded once, still contains a character reference that decodes again. That is a numeric reference such as &#39; or &#x27;, or a named one the parser recognises, such as &amp;, &quot; or &rsquo;, in each case ending with a semicolon. The og:title value falls back to twitter:title and then the page <title>, og:description to twitter:description and then <meta name="description">, and og:image:alt to twitter:image:alt. The message names each affected field by its og: name, whichever tag supplied the value, and quotes the first affected value with whitespace collapsed, shortened to 70 characters. A value meant to show literal entity text also raises it.

What it does to a shared link

The card shows the entity itself, such as &#39; where an apostrophe was meant.

How to fix it

  1. View the page source and find the affected attribute: a value escaped twice reads &amp;#39; or &amp;amp; where it should read &#39; or &amp;.
  2. Escape the value once: pass the raw string to the template, or mark an already-escaped value as safe so the template does not escape it again.
  3. Rebuild and confirm the attribute holds a single level of escaping.
<!-- escaped twice: the card shows What&#39;s new --> <meta property="og:title" content="What&amp;#39;s new"> <!-- escaped once: the card shows What's new --> <meta property="og:title" content="What&#39;s new">

Related checks