From d53c5a222202705dde2a6d017000f9df102c868b Mon Sep 17 00:00:00 2001 From: Herman Date: Tue, 10 Sep 2024 09:25:24 +0200 Subject: [PATCH] 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 Co-authored-by: Raja sekar --- .../marketplace/components/product-card/product-card.tsx | 9 +++++++-- .../51228-fix-wccom-21571-business-services-description | 4 ++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 plugins/woocommerce/changelog/51228-fix-wccom-21571-business-services-description diff --git a/plugins/woocommerce-admin/client/marketplace/components/product-card/product-card.tsx b/plugins/woocommerce-admin/client/marketplace/components/product-card/product-card.tsx index 7b8aba159fa..79585e83189 100644 --- a/plugins/woocommerce-admin/client/marketplace/components/product-card/product-card.tsx +++ b/plugins/woocommerce-admin/client/marketplace/components/product-card/product-card.tsx @@ -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 { ); + const decodedDescription = decodeEntities( product.description ); + const BusinessService = () => (
-

{ product.description }

+

+ { decodedDescription } +

{ product.productCategory } @@ -265,7 +270,7 @@ function ProductCard( props: ProductCardProps ): JSX.Element {
{ ! isTheme && (

- { ! isLoading && product.description } + { ! isLoading && decodedDescription }

) }