Skip to content

Commit 4e8973c

Browse files
fix: correct oembed iframe src (#283)
1 parent dc14e4a commit 4e8973c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lambda/oembed/oembed.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function handler(event, context, callback) {
3535
}
3636

3737
const { url, referrer, maxwidth = 900, maxheight = 300 } = params;
38+
const iframeSrc = `${url.replace('gist', 'embed')}?panes=preview,result`;
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)