Skip to content

Conversation

@nadeem-cs
Copy link
Contributor

No description provided.

@nadeem-cs nadeem-cs requested a review from a team as a code owner July 10, 2024 08:53
Comment on lines +108 to +114
const src = node.attrs['asset-link'];
const alt = node.attrs?.['redactor-attributes']?.['alt'];
const link = node.attrs.link;
const target = node.attrs.target || "";
const caption = node.attrs?.['redactor-attributes']?.['asset-caption'] || node.attrs?.['asset-caption'] || "";
const style = node.attrs.style;
const asset_uid= node.attrs['asset-uid'];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nadeem-cs [Minor] we can use destructuring to accessing the properties of node.attrs. like below
const {
'asset-link': src,
'redactor-attributes': { alt, 'asset-caption': redactorCaption } = {},
link,
target = "",
'asset-caption': assetCaption = "",
style,
'asset-uid': assetUid
} = node.attrs;

const caption = redactorCaption || assetCaption;

@nadeem-cs nadeem-cs merged commit 649b0b7 into next Jul 25, 2024
@cs-raj cs-raj deleted the fix/DX-887 branch August 16, 2024 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants