Skip to content

Commit

Permalink
Fix issue of HTML entities rendering in command menu (#62606)
Browse files Browse the repository at this point in the history
* Fix issue of HTML entities rendering in command menu

* Update link to API in block-editor README.md

* Undo previous changes

* Fix issue of HTML entities rendering in command menu

* Add @wordpress/html-entities dependency in packages/core-commands
  • Loading branch information
amitraj2203 authored Jun 27, 2024
1 parent 1998f1f commit b906b22
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 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/core-commands/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@wordpress/core-data": "file:../core-data",
"@wordpress/data": "file:../data",
"@wordpress/element": "file:../element",
"@wordpress/html-entities": "file:../html-entities",
"@wordpress/i18n": "file:../i18n",
"@wordpress/icons": "file:../icons",
"@wordpress/private-apis": "file:../private-apis",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { privateApis as routerPrivateApis } from '@wordpress/router';
import { addQueryArgs, getPath } from '@wordpress/url';
import { useDebounce } from '@wordpress/compose';
import { decodeEntities } from '@wordpress/html-entities';

/**
* Internal dependencies
Expand Down Expand Up @@ -93,7 +94,7 @@ const getNavigationCommandLoaderPerPostType = ( postType ) =>
name: postType + '-' + record.id,
searchLabel: record.title?.rendered + ' ' + record.id,
label: record.title?.rendered
? record.title?.rendered
? decodeEntities( record.title?.rendered )
: __( '(no title)' ),
icon: icons[ postType ],
};
Expand Down

0 comments on commit b906b22

Please sign in to comment.