Skip to content

Commit

Permalink
I think the PR - strip markup from link label data in inspector (#46171
Browse files Browse the repository at this point in the history
…) - meant to use `stripHTML`
  • Loading branch information
ramonjd committed Dec 5, 2022
1 parent 2a3901d commit 915344f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ import {
} from '@wordpress/block-editor';
import { isURL, prependHTTP } from '@wordpress/url';
import { Fragment, useState, useEffect, useRef } from '@wordpress/element';
import { placeCaretAtHorizontalEdge } from '@wordpress/dom';
import {
placeCaretAtHorizontalEdge,
__unstableStripHTML as stripHTML,
} from '@wordpress/dom';
import { link as linkIcon, addSubmenu } from '@wordpress/icons';
import {
store as coreStore,
useResourcePermissions,
} from '@wordpress/core-data';

import { useMergeRefs } from '@wordpress/compose';

/**
Expand Down Expand Up @@ -476,7 +478,7 @@ export default function NavigationLinkEdit( {
<InspectorControls>
<PanelBody title={ __( 'Link settings' ) }>
<TextControl
value={ label ? navStripHTML( label ) : '' }
value={ label ? stripHTML( label ) : '' }
onChange={ ( labelValue ) => {
setAttributes( { label: labelValue } );
} }
Expand Down

0 comments on commit 915344f

Please sign in to comment.