fix(storefront): STRF-10416 - Remove URL Encoding from Description in the Product Schema #2350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Updates the
description
in the schema.org product schema to remove url encoding. This schema is output into a "rich snippet" script on the PDP which is used by 3rd party platforms for accessing product details in a consistent way.The url encoding was resulting in undesired encoded characters showing up in places the description was used, like when linking a product to pinterest.
For example, I setup a product with a description that resulted in this value being printed into the HTML of the page:
This caused things like the
%20
(instead of a space) to persist in the description pulled into pinterest when using the "share on pinterest" button that can be enabled on a PDP. With my changes the description instead looks like this:Html encoded characters (like
&
and'
) are still used and do display properly on the pinterest side as seen in the images below.Requirements
Tickets / Documentation
https://bigcommercecloud.atlassian.net/browse/STRF-10416
Screenshots (if appropriate)
Here is an example of how the results in pinterest look with our current url encoding:
Here is how it looks with the change in this PR: