I use Contentful and have issue doing custom formatting when my RichText receives the content.json for rendering.
In the case of [BLOCKS.EMBEDDED_ASSET] nodes I try to “process” them in Options but the url itself of the asset is not in that node unfortunately. I found the way to find the url is to look on content.links (no content.json) but that doesn’t seem to be accessible from OPTIONS
[BLOCKS.EMBEDDED_ASSET]: (node) => {
console.log("Apply Options asset-hyperlink");
return (
<img
src={node.links?}
height='600'
width='400'
className='h-20 w-20'
/>
)
}
Some older code with Contentful CMS used:
return (
<ContentfulImage
src={node.data.target.fields.file.url}
height={node.data.target.fields.file.details.image.height}
width={node.data.target.fields.file.details.image.width}
alt={node.data.target.fields.title}
className='h-20 w-20'
/>
)
but node.data.target.fields does not exist anymore