fix(web): add aspect-ratio fallback for markdown inline images
This commit is contained in:
@@ -187,14 +187,19 @@ function buildComponents(): Components {
|
|||||||
|
|
||||||
// Images (in markdown content — not attachments)
|
// Images (in markdown content — not attachments)
|
||||||
img: ({ src, alt }) => (
|
img: ({ src, alt }) => (
|
||||||
|
<div
|
||||||
|
className="mt-1 rounded-md overflow-hidden bg-surface-input"
|
||||||
|
style={{ aspectRatio: '4/3', maxWidth: 400, maxHeight: 300 }}
|
||||||
|
>
|
||||||
<img
|
<img
|
||||||
src={src}
|
src={src}
|
||||||
alt={alt ?? ''}
|
alt={alt ?? ''}
|
||||||
className="max-w-[400px] max-h-[300px] rounded-md mt-1"
|
className="w-full h-full object-contain"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
referrerPolicy="no-referrer"
|
referrerPolicy="no-referrer"
|
||||||
crossOrigin="anonymous"
|
crossOrigin="anonymous"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
),
|
),
|
||||||
|
|
||||||
// Tables (GFM)
|
// Tables (GFM)
|
||||||
|
|||||||
Reference in New Issue
Block a user