fix(web): add aspect-ratio fallback for markdown inline images

This commit is contained in:
Jannis Braun
2026-03-25 01:56:33 +01:00
parent 995c71367e
commit 30c3b9b352
@@ -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)