Fix in-app product card descriptions (#51228)

* Add classname to description section for business service card

* Decode HTML entities in product descriptions

* Add changefile(s) from automation for the following project(s): woocommerce

---------

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Raja sekar <raja.sekar.manimaran@automattic.com>
This commit is contained in:
Herman 2024-09-10 09:25:24 +02:00 committed by GitHub
parent 904dfaa2ff
commit d53c5a2222
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -6,6 +6,7 @@ import { Card } from '@wordpress/components';
import clsx from 'clsx';
import { ExtraProperties, queueRecordEvent } from '@woocommerce/tracks';
import { useQuery } from '@woocommerce/navigation';
import { decodeEntities } from '@wordpress/html-entities';
/**
* Internal dependencies
@ -161,6 +162,8 @@ function ProductCard( props: ProductCardProps ): JSX.Element {
</a>
);
const decodedDescription = decodeEntities( product.description );
const BusinessService = () => (
<div className="woocommerce-marketplace__business-card">
<div
@ -174,7 +177,9 @@ function ProductCard( props: ProductCardProps ): JSX.Element {
<h2>
<CardLink />
</h2>
<p>{ product.description }</p>
<p className="woocommerce-marketplace__product-card__description">
{ decodedDescription }
</p>
</div>
<div className="woocommerce-marketplace__business-card__badge">
<span>{ product.productCategory }</span>
@ -265,7 +270,7 @@ function ProductCard( props: ProductCardProps ): JSX.Element {
</div>
{ ! isTheme && (
<p className="woocommerce-marketplace__product-card__description">
{ ! isLoading && product.description }
{ ! isLoading && decodedDescription }
</p>
) }
<footer className="woocommerce-marketplace__product-card__footer">

View File

@ -0,0 +1,4 @@
Significance: patch
Type: tweak
Minor fixes to product descriptions on the Extensions screen.