Skip to content

Commit 641e84f

Browse files
committed
fix(oEmbed): Bring iframe in line with the embed in the GUI
1 parent dc14e4a commit 641e84f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lambda/oembed/oembed.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ function handler(event, context, callback) {
3434
);
3535
}
3636

37-
const { url, referrer, maxwidth = 900, maxheight = 300 } = params;
37+
const { url, referrer, maxwidth = '100%', maxheight = 300 } = params;
38+
const iframeSrc = url.replace('gist', 'embed');
3839

3940
callback(null, {
4041
statusCode: 200,
@@ -47,7 +48,7 @@ function handler(event, context, callback) {
4748
provider_name: 'testing-playground.com',
4849
provider_url: host,
4950

50-
html: `<iframe src="${url}" width="${maxwidth}" height="${maxheight}" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" title="Testing Playground" style="overflow: hidden; display: block;" loading="lazy" name="testing-playground-${Date.now()}"></iframe>`,
51+
html: `<iframe src="${iframeSrc}" height="${maxheight}" width="${maxwidth}" scrolling="no" frameBorder="0" allowTransparency="true" title="Testing Playground" style="overflow: hidden; display: block; width: 100%"></iframe>`,
5152
width: maxwidth,
5253
height: maxheight,
5354

0 commit comments

Comments
 (0)