Skip to content

Commit 1ee17f7

Browse files
MichaelDeBoeyCompuIves
authored andcommitted
Update embed docs to be in line with actual implementation (#2923)
1 parent fb359cc commit 1ee17f7

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

packages/app/src/app/pages/common/Modals/ShareModal/getCode.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ export const getEmbedUrl = (sandbox, mainModule, state) =>
6666
getOptionsUrl(sandbox, mainModule, state);
6767

6868
export const getIframeScript = (sandbox, mainModule, state) =>
69-
`<iframe src="${getEmbedUrl(sandbox, mainModule, state)}" title="${escapeHtml(
70-
getSandboxName(sandbox)
71-
)}" allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>`;
69+
`<iframe
70+
src="${getEmbedUrl(sandbox, mainModule, state)}"
71+
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
72+
title="${escapeHtml(getSandboxName(sandbox))}"
73+
allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
74+
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
75+
></iframe>`;
7276

7377
// eslint-disable-next-line
7478
export const getButtonMarkdown = (sandbox, mainModule, state) => {

packages/homepage/content/docs/2-embedding.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,18 @@ This embed is focused on being as light as possible:
6262

6363
Use this code to embed:
6464

65-
`<iframe src="https://codesandbox.io/embed/new?codemirror=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>`
65+
```html
66+
<iframe
67+
src="https://codesandbox.io/embed/new?codemirror=1"
68+
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
69+
allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
70+
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
71+
></iframe>
72+
```
6673

6774
That will give to a result like this:
6875

69-
<iframe src="https://codesandbox.io/embed/new?codemirror=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>
76+
<iframe src="https://codesandbox.io/embed/new?codemirror=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>
7077

7178
### Code Example Embed
7279

@@ -77,8 +84,15 @@ is only supported with the CodeMirror editor currently:
7784

7885
Use this code to embed:
7986

80-
`<iframe src="https://codesandbox.io/embed/new?codemirror=1&highlights=11,12,13,14" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>`
87+
```html
88+
<iframe
89+
src="https://codesandbox.io/embed/new?codemirror=1&highlights=11,12,13,14"
90+
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
91+
allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb"
92+
sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"
93+
></iframe>
94+
```
8195

8296
That will give to a result like this:
8397

84-
<iframe src="https://codesandbox.io/embed/new?codemirror=1&highlights=11,12,13,14" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>
98+
<iframe src="https://codesandbox.io/embed/new?codemirror=1&highlights=11,12,13,14" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="geolocation; microphone; camera; midi; vr; accelerometer; gyroscope; payment; ambient-light-sensor; encrypted-media; usb" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>

0 commit comments

Comments
 (0)