aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar makc2024-03-22 00:11:36 +0400
committerGravatar makc2024-03-22 00:11:36 +0400
commit02d99a215b07e837cd0b1f1da1df7471588f8ce6 (patch)
treeb4ea34a343934147fffe6da4078a72a189630c53
parenta4d9152855f4fd90fcd19e3250997d7ad0f3ef19 (diff)
fix instagram embeds
-rw-r--r--vnext/src/utils/embed.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/vnext/src/utils/embed.js b/vnext/src/utils/embed.js
index 7c1c5c3b..a538a1a8 100644
--- a/vnext/src/utils/embed.js
+++ b/vnext/src/utils/embed.js
@@ -290,9 +290,10 @@ function getEmbeddableLinkTypes() {
re: /https?:\/\/www\.?instagram\.com(\/p\/\w+)\/?/i,
makeNode: function(aNode, reResult, div) {
let [, postId] = reResult
- let mediaUrl = `https://instagr.am${postId}/media`
- div.innerHTML = `<a href="${aNode.href}"><img src="${mediaUrl}"></a>`
- return div
+ let iframeUrl = `https://www.instagram.com${postId}/embed/captioned/`
+ let iframe = makeIframe(iframeUrl, '100%', '480px')
+ iframe.onload = () => makeResizableToRatio(iframe, 1)
+ return setContent(div, iframe)
}
},
{