From 4cb90e4e073f3695b60145e7aaa7f6056eb543fd Mon Sep 17 00:00:00 2001 From: Kelly Dwan Date: Thu, 23 Jul 2020 17:06:11 -0400 Subject: [PATCH 1/2] Block Directory: Decode entities in block title & description --- packages/block-directory/package.json | 1 + .../src/components/downloadable-block-header/index.js | 3 ++- .../src/components/downloadable-block-info/index.js | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/block-directory/package.json b/packages/block-directory/package.json index 9541c9f5887e86..a47f663effc15c 100644 --- a/packages/block-directory/package.json +++ b/packages/block-directory/package.json @@ -35,6 +35,7 @@ "@wordpress/data-controls": "file:../data-controls", "@wordpress/edit-post": "file:../edit-post", "@wordpress/element": "file:../element", + "@wordpress/html-entities": "file:../html-entities", "@wordpress/i18n": "file:../i18n", "@wordpress/icons": "file:../icons", "@wordpress/notices": "file:../notices", diff --git a/packages/block-directory/src/components/downloadable-block-header/index.js b/packages/block-directory/src/components/downloadable-block-header/index.js index 9508ee940f86ba..1917e68c14ee7f 100644 --- a/packages/block-directory/src/components/downloadable-block-header/index.js +++ b/packages/block-directory/src/components/downloadable-block-header/index.js @@ -3,6 +3,7 @@ */ import { __ } from '@wordpress/i18n'; import { Button } from '@wordpress/components'; +import { decodeEntities } from '@wordpress/html-entities'; /** * Internal dependencies @@ -25,7 +26,7 @@ function DownloadableBlockHeader( {

- { title } + { decodeEntities( title ) }

diff --git a/packages/block-directory/src/components/downloadable-block-info/index.js b/packages/block-directory/src/components/downloadable-block-info/index.js index ed4f753ec58d29..fb932e77ba0c18 100644 --- a/packages/block-directory/src/components/downloadable-block-info/index.js +++ b/packages/block-directory/src/components/downloadable-block-info/index.js @@ -1,8 +1,9 @@ /** * WordPress dependencies */ -import { Fragment } from '@wordpress/element'; import { __, _n, sprintf } from '@wordpress/i18n'; +import { decodeEntities } from '@wordpress/html-entities'; +import { Fragment } from '@wordpress/element'; import { Icon, update, chartLine } from '@wordpress/icons'; function DownloadableBlockInfo( { @@ -13,7 +14,7 @@ function DownloadableBlockInfo( { return (

- { description } + { decodeEntities( description ) }

Date: Mon, 27 Jul 2020 17:34:08 -0400 Subject: [PATCH 2/2] Update package-lock.json --- package-lock.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package-lock.json b/package-lock.json index 8c988d1cf45354..2d333b0c1a5dd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10953,6 +10953,7 @@ "@wordpress/data-controls": "file:packages/data-controls", "@wordpress/edit-post": "file:packages/edit-post", "@wordpress/element": "file:packages/element", + "@wordpress/html-entities": "file:packages/html-entities", "@wordpress/i18n": "file:packages/i18n", "@wordpress/icons": "file:packages/icons", "@wordpress/notices": "file:packages/notices",