Skip to content

Commit 00bf7eb

Browse files
committed
Move decoding to where it is actually required
1 parent 2a73216 commit 00bf7eb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/block-library/src/navigation-link/edit.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export const updateNavigationLinkBlockAttributes = (
236236

237237
const normalizedURL = url.replace( /http(s?):\/\//gi, '' );
238238

239-
const label = decodeEntities( title ) || originalLabel || normalizedURL;
239+
const label = title || originalLabel || normalizedURL;
240240

241241
// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
242242
const type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );
@@ -793,7 +793,9 @@ export default function NavigationLinkEdit( {
793793
<span>
794794
{
795795
/* Trim to avoid trailing white space when the placeholder text is not present */
796-
`${ label } ${ placeholderText }`.trim()
796+
`${ decodeEntities(
797+
label
798+
) } ${ placeholderText }`.trim()
797799
}
798800
</span>
799801
<span className="wp-block-navigation-link__missing_text-tooltip">

0 commit comments

Comments
 (0)