File tree 3 files changed +9
-9
lines changed
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ describe('gatsby-remark-embedder', () => {
47
47
48
48
<iframe src=\\"https://codepen.io/team/codepen/embed/preview/PNaGbb\\" style=\\"width:100%; height:300px;\\"></iframe>
49
49
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>
51
51
52
52
<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>
53
53
@@ -87,10 +87,10 @@ describe('gatsby-remark-embedder', () => {
87
87
await expect (
88
88
plugin ( { cache, markdownAST } , { customTransformers : [ errorTransformer ] } )
89
89
) . 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/':
91
91
92
- An error occurred in ErrorTransformer]
93
- ` ) ;
92
+ An error occurred in ErrorTransformer]
93
+ `) ;
94
94
} ) ;
95
95
96
96
cases (
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ test('Gets the correct CodeSandbox iframe', () => {
46
46
const html = getHTML ( 'https://codesandbox.io/s/ynn88nx9x' ) ;
47
47
48
48
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>"`
50
50
) ;
51
51
} ) ;
52
52
@@ -64,11 +64,11 @@ test('Plugin can transform CodeSandbox links', async () => {
64
64
65
65
<https://codesandbox.io/embed/ynn88nx9x>
66
66
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>
68
68
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>
70
70
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>
72
72
"
73
73
` ) ;
74
74
} ) ;
Original file line number Diff line number Diff line change @@ -10,5 +10,5 @@ export const shouldTransform = (url) => {
10
10
export const getHTML = ( url ) => {
11
11
const iframeUrl = url . replace ( '/s/' , '/embed/' ) ;
12
12
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>` ;
14
14
} ;
You can’t perform that action at this time.
0 commit comments