Skip to content

Commit

Permalink
Block Directory: Decode entities in block title & description (#24172)
Browse files Browse the repository at this point in the history
* Block Directory: Decode entities in block title & description

* Update package-lock.json
  • Loading branch information
ryelle authored Aug 3, 2020
1 parent 2043458 commit 799e355
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/block-directory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import { __ } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
import { decodeEntities } from '@wordpress/html-entities';

/**
* Internal dependencies
Expand All @@ -25,7 +26,7 @@ function DownloadableBlockHeader( {

<div className="block-directory-downloadable-block-header__column">
<h2 className="block-directory-downloadable-block-header__title">
{ title }
{ decodeEntities( title ) }
</h2>
<BlockRatings rating={ rating } ratingCount={ ratingCount } />
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -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( {
Expand All @@ -13,7 +14,7 @@ function DownloadableBlockInfo( {
return (
<Fragment>
<p className="block-directory-downloadable-block-info__content">
{ description }
{ decodeEntities( description ) }
</p>
<div className="block-directory-downloadable-block-info__meta">
<Icon
Expand Down

0 comments on commit 799e355

Please sign in to comment.