Skip to content

Commit

Permalink
Move decoding to where it is actually required
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed May 19, 2022
1 parent 428f615 commit dfc35c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ export const updateNavigationLinkBlockAttributes = (

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

const label = decodeEntities( title ) || originalLabel || normalizedURL;
const label = title || originalLabel || normalizedURL;

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

0 comments on commit dfc35c7

Please sign in to comment.