Skip to content

Commit

Permalink
Lodash: Refactor Categories block away from _.unescape()
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Jan 30, 2023
1 parent f678550 commit 18f9419
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/block-library/src/categories/edit.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* External dependencies
*/
import { unescape } from 'lodash';
import classnames from 'classnames';

/**
Expand All @@ -16,6 +15,7 @@ import {
} from '@wordpress/components';
import { useInstanceId } from '@wordpress/compose';
import { InspectorControls, useBlockProps } from '@wordpress/block-editor';
import { decodeEntities } from '@wordpress/html-entities';
import { __ } from '@wordpress/i18n';
import { pin } from '@wordpress/icons';
import { useEntityRecords } from '@wordpress/core-data';
Expand Down Expand Up @@ -57,7 +57,7 @@ export default function CategoriesEdit( {
setAttributes( { [ attributeName ]: newValue } );

const renderCategoryName = ( name ) =>
! name ? __( '(Untitled)' ) : unescape( name ).trim();
! name ? __( '(Untitled)' ) : decodeEntities( name ).trim();

const renderCategoryList = () => {
const parentId = showHierarchy ? 0 : null;
Expand Down

0 comments on commit 18f9419

Please sign in to comment.