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 }) => (
<img <div
src={src} className="mt-1 rounded-md overflow-hidden bg-surface-input"
alt={alt ?? ''} style={{ aspectRatio: '4/3', maxWidth: 400, maxHeight: 300 }}
className="max-w-[400px] max-h-[300px] rounded-md mt-1" >
loading="lazy" <img
referrerPolicy="no-referrer" src={src}
crossOrigin="anonymous" alt={alt ?? ''}
/> className="w-full h-full object-contain"
loading="lazy"
referrerPolicy="no-referrer"
crossOrigin="anonymous"
/>
</div>
), ),
// Tables (GFM) // Tables (GFM)