mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-29 21:51:39 +01:00
Move away from Object.assign for image rendering.
This commit is contained in:
parent
da48ddec83
commit
c620e9c930
@ -50,13 +50,11 @@ function renderList(listBlock) {
|
||||
}
|
||||
|
||||
function renderImage(imagePart) {
|
||||
const attributes = Object.assign(
|
||||
{ src: imagePart.src },
|
||||
imagePart.width && { width: imagePart.width },
|
||||
imagePart.height && { height: imagePart.height },
|
||||
imagePart.alt && { alt: imagePart.alt },
|
||||
imagePart.title && { title: imagePart.title }
|
||||
);
|
||||
const attributes = { src: imagePart.src };
|
||||
if (imagePart.width) { attributes.width = imagePart.width }
|
||||
if (imagePart.height) { attributes.height = imagePart.height }
|
||||
if (imagePart.alt) { attributes.alt = imagePart.alt }
|
||||
if (imagePart.title) { attributes.title = imagePart.title }
|
||||
return tag.img(attributes);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user