Skip to content

Commit 5abfd51

Browse files
committed
fix(CodeSandbox): Update sandbox config
1 parent dfe8753 commit 5abfd51

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

Diff for: src/__tests__/plugin.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ describe('gatsby-remark-embedder', () => {
4747
4848
<iframe src=\\"https://codepen.io/team/codepen/embed/preview/PNaGbb\\" style=\\"width:100%; height:300px;\\"></iframe>
4949
50-
<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x?view=split\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
50+
<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x?view=split\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
5151
5252
<div style=\\"width:100%;height:0;padding-bottom:63%;position:relative;\\"><iframe src=\\"https://giphy.com/embed/XatG8bioEwwVO\\" width=\\"100%\\" height=\\"100%\\" style=\\"position:absolute\\" frameborder=\\"0\\" class=\\"giphy-embed-from-cache\\" allowfullscreen></iframe></div>
5353
@@ -87,10 +87,10 @@ describe('gatsby-remark-embedder', () => {
8787
await expect(
8888
plugin({ cache, markdownAST }, { customTransformers: [errorTransformer] })
8989
).rejects.toMatchInlineSnapshot(`
90-
[Error: The following error appeared while processing 'https://error-site.com/':
90+
[Error: The following error appeared while processing 'https://error-site.com/':
9191
92-
An error occurred in ErrorTransformer]
93-
`);
92+
An error occurred in ErrorTransformer]
93+
`);
9494
});
9595

9696
cases(

Diff for: src/__tests__/transformers/CodeSandbox.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ test('Gets the correct CodeSandbox iframe', () => {
4646
const html = getHTML('https://codesandbox.io/s/ynn88nx9x');
4747

4848
expect(html).toMatchInlineSnapshot(
49-
`"<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>"`
49+
`"<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>"`
5050
);
5151
});
5252

@@ -64,11 +64,11 @@ test('Plugin can transform CodeSandbox links', async () => {
6464
6565
<https://codesandbox.io/embed/ynn88nx9x>
6666
67-
<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
67+
<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
6868
69-
<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x?view=split\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
69+
<iframe src=\\"https://codesandbox.io/embed/ynn88nx9x?view=split\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
7070
71-
<iframe src=\\"https://www.codesandbox.io/embed/ynn88nx9x\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
71+
<iframe src=\\"https://www.codesandbox.io/embed/ynn88nx9x\\" style=\\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\\" allow=\\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\\" sandbox=\\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\\"></iframe>
7272
"
7373
`);
7474
});

Diff for: src/transformers/CodeSandbox.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ export const shouldTransform = (url) => {
1010
export const getHTML = (url) => {
1111
const iframeUrl = url.replace('/s/', '/embed/');
1212

13-
return `<iframe src="${iframeUrl}" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-autoplay allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>`;
13+
return `<iframe src="${iframeUrl}" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>`;
1414
};

0 commit comments

Comments
 (0)