diff --git a/web/src/ui/timeline/content/MessageBody.tsx b/web/src/ui/timeline/content/MessageBody.tsx
index f58e3d9..b3e1f35 100644
--- a/web/src/ui/timeline/content/MessageBody.tsx
+++ b/web/src/ui/timeline/content/MessageBody.tsx
@@ -79,15 +79,15 @@ const MessageBody = ({ event }: EventContentProps) => {
case "m.image": {
const openLightbox = use(LightboxContext)
const style = calculateMediaSize(content.info?.w, content.info?.h)
- if (content.url) {
- return
-
})
-
- } else if (content.file) {
- return
-
})
-
- }
+ return
+

+
}
}
return
{`{ "type": "${event.type}" }`}
diff --git a/web/src/util/html.ts b/web/src/util/html.ts
index 77adabd..1a04718 100644
--- a/web/src/util/html.ts
+++ b/web/src/util/html.ts
@@ -85,6 +85,7 @@ export const transformTags: NonNullable
}
attribs.src = getMediaURL(src)!
+ attribs.loading = "lazy"
return { tagName, attribs }
},
"code": function(tagName: string, attribs: sanitizeHtml.Attributes) {
@@ -188,7 +189,7 @@ export const sanitizeHtmlParams: sanitizeHtml.IOptions = {
// eslint-disable-next-line id-length
a: ["href", "name", "target", "rel"], // remote target: custom to matrix
// img tags also accept width/height, we just map those to max-width & max-height during transformation
- img: ["src", "alt", "title", "style", "data-mx-emoticon"],
+ img: ["src", "alt", "title", "style", "loading", "data-mx-emoticon"],
ol: ["start"],
code: ["class"], // We don't actually allow all classes, we filter them in transformTags
},