Skip to content

Commit

Permalink
Don’t use label in preview title and this represents an entity
Browse files Browse the repository at this point in the history
  • Loading branch information
getdave committed Sep 7, 2023
1 parent b711746 commit d8cafba
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit d8cafba

Please sign in to comment.