From d8cafba6613b8cc6dbb76e13da5275be29945a55 Mon Sep 17 00:00:00 2001 From: Dave Smith Date: Fri, 26 May 2023 10:29:13 +0100 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20use=20label=20in=20preview=20ti?= =?UTF-8?q?tle=20and=20this=20represents=20an=20entity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/link-control/link-preview.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/block-editor/src/components/link-control/link-preview.js b/packages/block-editor/src/components/link-control/link-preview.js index 8d01d0c45e074..5ea7ec1c32748 100644 --- a/packages/block-editor/src/components/link-control/link-preview.js +++ b/packages/block-editor/src/components/link-control/link-preview.js @@ -38,13 +38,11 @@ export default function LinkPreview( { ( value && filterURLForDisplay( safeDecodeURI( value.url ), 16 ) ) || ''; + const displayTitle = stripHTML( richData?.title || displayURL ); + // url can be undefined if the href attribute is unset const isEmptyURL = ! value?.url?.length; - const displayTitle = - ! isEmptyURL && - stripHTML( richData?.title || value?.title || displayURL ); - let icon; if ( richData?.icon ) {