diff --git a/components/JsonToHtml/jsontohtml.module.css b/components/JsonToHtml/jsontohtml.module.css index a85bf0e38..12bfd0bc8 100644 --- a/components/JsonToHtml/jsontohtml.module.css +++ b/components/JsonToHtml/jsontohtml.module.css @@ -1,10 +1,15 @@ -.image { - max-width: 100%; +.imageContainer { + position: relative; width: 100%; height: 365px; - object-fit: cover; border-radius: var(--Corner-radius-Medium); margin: var(--Spacing-x1) var(--Spacing-x0); + overflow: hidden; +} + +.image { + width: 100%; + object-fit: cover; } .ul, diff --git a/components/JsonToHtml/renderOptions.tsx b/components/JsonToHtml/renderOptions.tsx index 3e09663b9..845813508 100644 --- a/components/JsonToHtml/renderOptions.tsx +++ b/components/JsonToHtml/renderOptions.tsx @@ -325,14 +325,16 @@ export const renderOptions: RenderOptions = { const props = extractPossibleAttributes(node.attrs) props.className = styles.image return ( - {alt} +
+ {alt} +
) } } @@ -393,22 +395,20 @@ export const renderOptions: RenderOptions = { image = insertResponseToImageVaultAsset(attrs) } const alt = image.meta.alt ?? image.title - - const width = attrs.width - ? parseInt(attrs.width.replaceAll("px", "")) - : image.dimensions.width const props = extractPossibleAttributes(attrs) return (
- {alt} +
+ {alt} +
{image.meta.caption}
) diff --git a/components/JsonToHtml/utils.tsx b/components/JsonToHtml/utils.tsx index b2a8d838e..d594d4c65 100644 --- a/components/JsonToHtml/utils.tsx +++ b/components/JsonToHtml/utils.tsx @@ -113,6 +113,7 @@ export function nodeToHtml( if ("type" in node === false) { return textNodeToHtml(node, fullRenderOptions) } else { + console.log({ NODE: node, EMBEDS: embeds }) if (fullRenderOptions[node.type] !== undefined) { if (node.type === RTETypeEnum.doc) { return null