Decode HTML entities in tag output, e.g. &309; becomes an apostrophe

Created on 29 April 2017, about 7 years ago
Updated 6 February 2024, 5 months ago

Problem/Motivation

Even using the latest 8.x-dev version, I still have apostrophe encoding issues in my metatag. I can fine multiple issues about in the issue queue, all are flagged 'fixed' suggesting it works. For instance:
#2649592: Write tests to cover apostrophe handling in meta tags β†’

Yet if I enter "alex's" in any metatag it gets outputted like:

<meta name="title" content="alex&#039;s title" />
<meta name="description" content="alex&#039;s description" />
<meta name="abstract" content="alex&#039;s" />
<meta name="keywords" content="alex&#039;s" />

I would expect view source to show:

<meta name="title" content="alex's" />
<meta name="description" content="alex's" />
<meta name="abstract" content="alex's" />
<meta name="keywords" content="alex's" />

Proposed resolution

Change the output so that HTML entities are not encoded.

Remaining tasks

  • Change the existing tests to check for plain strings in the output instead of encoded HTML entities.
  • Ensure that the quotation marks are not broken, i.e. don't introduce any XSS bugs.
  • Adjust the module's output accordingly.
✨ Feature request
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France Dom.

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024