It would be nice if this was more customizable. I could imagine either:
An option for each different possible parameter
A getUrl or similar function to override the URL completely
Use Case
I am including links in the page instead of embedded sandboxes, and want to link to the full sandbox page.
Workaround
Manually .replace the necessary parts of the URL in getIframe:
options: {
// ...
// Remove all embed options because we're not currently using embeds
embedOptions: {},
// Customize the output of the plugin:
// - Use a link instead of an iFrame
// - Link to the full Sandbox URL instead of the embed version
getIframe: url =>
`<a
href="${url.replace('embed=1&','',)}"
target="_blank"
rel="nofollow,noopener,noreferrer"
>CodeSandbox</a>`,
},
At the moment, some parts of the url such as
embed
are hard coded:https://github.com/elboman/gatsby-remark-embedded-codesandbox/blob/db82541c2977c3ec613d446c2908b5d8e64daaaa/src/index.js#L135
It would be nice if this was more customizable. I could imagine either:
getUrl
or similar function to override the URL completelyUse Case
I am including links in the page instead of embedded sandboxes, and want to link to the full sandbox page.
Workaround
Manually
.replace
the necessary parts of the URL ingetIframe
: