jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Jetpack Social Preview does not render & properly

Open devNigel opened this issue 3 years ago • 2 comments

Quick summary

The Jetpack Social Preview does not render & symbol properly in Simple sites. It works fine on Atomic Sites.

Steps to reproduce

  1. Open a simple site and create a new post or page.
  2. Add & symbol in the title.
  3. Check Jetpack Social Preview
image image

What you expected to happen

Social Preview should render & symbol correctly.

What actually happened

Social Preview rendered & symbol as &

Context

User report: 24756386-hc

Platform (Simple, Atomic, or both?)

Simple

Theme-specific issue?

No

Browser, operating system and other notes

No response

Reproducibility

Consistent

Severity

All

Available workarounds?

No but the platform is still usable

Workaround details

No response

devNigel avatar Oct 07 '22 03:10 devNigel

📌 SCRUBBING : RESULT

  • Tested on Simple: Replicated

📌 FINDINGS/SCREENSHOTS/VIDEO

  • Replicated issue as described.
  • Before publishing the post, when I checked Jetpack Social Preview, the & rendered in the title, but not in the content of the post.
  • After publishing the post, the & was not rendered in either place.

Example: Before Publishing Markup on 2022-10-11 at 10:11:03

Example: After Publishing Markup on 2022-10-11 at 10:12:18

📌 ACTIONS

  • Marked as Triaged for Quality Squad review

cuemarie avatar Oct 11 '22 17:10 cuemarie

Pinging @Automattic/jetpack-reach for this one.

coder-karen avatar Oct 12 '22 09:10 coder-karen

This is an issue with core escaping special characters in the post attributes. I've traced it back to getEditedPostAttribute in the plugin, which accesses a core data store; example code for the title:

https://github.com/Automattic/jetpack/blob/5655e5e419c021d216f27382e4df82af979669cc/projects/js-packages/publicize-components/src/components/social-previews/use-post-data.js#L65-L66

If you use the Jetpack advanced SEO tools, the copy doesn't escape the &, but if we fall back to core's title/description, it will. Examples:

With Jetpack's advanced SEO title/description set:

Image

Fallback to core title/description:

Image

It likely needs to be addressed in core, or we need to decode special characters on the Jetpack side explicitly.

sixhours avatar Nov 19 '24 16:11 sixhours