Allow built in payment method descriptions to contain HTML when rendered on the block checkout (#42706)
This commit is contained in:
commit
db9be95f5d
|
@ -5,6 +5,8 @@ import { registerPaymentMethod } from '@woocommerce/blocks-registry';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { getPaymentMethodData } from '@woocommerce/settings';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { sanitizeHTML } from '@woocommerce/utils';
|
||||
import { RawHTML } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -19,7 +21,7 @@ const label = decodeEntities( settings?.title || '' ) || defaultLabel;
|
|||
* Content component
|
||||
*/
|
||||
const Content = () => {
|
||||
return decodeEntities( settings.description || '' );
|
||||
return <RawHTML>{ sanitizeHTML( settings.description || '' ) }</RawHTML>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,8 @@ import { registerPaymentMethod } from '@woocommerce/blocks-registry';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { getPaymentMethodData } from '@woocommerce/settings';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { sanitizeHTML } from '@woocommerce/utils';
|
||||
import { RawHTML } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -19,7 +21,7 @@ const label = decodeEntities( settings?.title || '' ) || defaultLabel;
|
|||
* Content component
|
||||
*/
|
||||
const Content = () => {
|
||||
return decodeEntities( settings.description || '' );
|
||||
return <RawHTML>{ sanitizeHTML( settings.description || '' ) }</RawHTML>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,8 @@ import { registerPaymentMethod } from '@woocommerce/blocks-registry';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { getPaymentMethodData } from '@woocommerce/settings';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { sanitizeHTML } from '@woocommerce/utils';
|
||||
import { RawHTML } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -19,7 +21,7 @@ const label = decodeEntities( settings?.title || '' ) || defaultLabel;
|
|||
* Content component
|
||||
*/
|
||||
const Content = () => {
|
||||
return decodeEntities( settings.description || '' );
|
||||
return <RawHTML>{ sanitizeHTML( settings.description || '' ) }</RawHTML>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,8 @@ import { registerPaymentMethod } from '@woocommerce/blocks-registry';
|
|||
import { __ } from '@wordpress/i18n';
|
||||
import { getPaymentMethodData, WC_ASSET_URL } from '@woocommerce/settings';
|
||||
import { decodeEntities } from '@wordpress/html-entities';
|
||||
import { sanitizeHTML } from '@woocommerce/utils';
|
||||
import { RawHTML } from '@wordpress/element';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -17,7 +19,7 @@ const settings = getPaymentMethodData( 'paypal', {} );
|
|||
* Content component
|
||||
*/
|
||||
const Content = () => {
|
||||
return decodeEntities( settings.description || '' );
|
||||
return <RawHTML>{ sanitizeHTML( settings.description || '' ) }</RawHTML>;
|
||||
};
|
||||
|
||||
const paypalPaymentMethod = {
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Allow built in payment method descriptions to contain HTML when rendered on the block checkout.
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: update
|
||||
|
||||
Allow built in payment method descriptions to contain HTML when rendered on the block checkout.
|
Loading…
Reference in New Issue