Convert HTML to blocks in product variation description (#36241)

* Convert HTML to blocks in product variation description

* Add changelog entry
This commit is contained in:
Joshua T Flowers 2023-01-03 16:25:12 -08:00 committed by GitHub
parent 302dab0521
commit 421fc3e30b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -2,7 +2,7 @@
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { BlockInstance, serialize, parse } from '@wordpress/blocks';
import { BlockInstance, serialize, rawHandler } from '@wordpress/blocks';
import {
CheckboxControl,
Card,
@ -55,7 +55,7 @@ export const ProductVariationDetailsSection: React.FC = () => {
const [ descriptionBlocks, setDescriptionBlocks ] = useState<
BlockInstance[]
>( parse( values.description || '' ) );
>( rawHandler( { HTML: values.description } ) );
const imageFieldProps = getInputProps( 'image' );

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Convert HTML to blocks in product variation description