aboutsummaryrefslogtreecommitdiff
path: root/vnext/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2024-05-24 14:28:41 +0300
committerGravatar Vitaly Takmazov2024-05-24 14:28:41 +0300
commit65d5b915104fc79a3e8425466b6e2b88c1f35828 (patch)
tree7b034e2f6b94ccd3477cb3c7102b5dfd230c83b1 /vnext/src
parent61839854f6f889a7d3d2e1d7eaac6fcd13df4a84 (diff)
embed.js: lazy image loading
Diffstat (limited to 'vnext/src')
-rw-r--r--vnext/src/utils/embed.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/vnext/src/utils/embed.js b/vnext/src/utils/embed.js
index a538a1a8..fcef651d 100644
--- a/vnext/src/utils/embed.js
+++ b/vnext/src/utils/embed.js
@@ -180,7 +180,7 @@ function getEmbeddableLinkTypes() {
makeNode: function(aNode, reResult, div) {
// dirty fix for dropbox urls
let url = aNode.href.endsWith('dl=0') ? aNode.href.replace('dl=0', 'raw=1') : aNode.href
- div.innerHTML = `<a href="${url}"><img src="${url}"></a>`
+ div.innerHTML = `<a href="${url}"><img loading="lazy" src="${url}"></a>`
return div
}
},
@@ -190,7 +190,7 @@ function getEmbeddableLinkTypes() {
className: 'picture compact',
re: /\.gif(:[a-zA-Z]+)?(?:\?[\w&;?=]*)?$/i,
makeNode: function(aNode, reResult, div) {
- div.innerHTML = `<a href="${aNode.href}"><img src="${aNode.href}"></a>`
+ div.innerHTML = `<a href="${aNode.href}"><img loading="lazy" src="${aNode.href}"></a>`
return div
}
},