We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents b27eca9 + 792cfd0 commit 70890afCopy full SHA for 70890af
src/components/CodeEmbed/frame.tsx
@@ -42,7 +42,9 @@ canvas {
42
}
43
${code.css || ""}
44
</style>
45
-${(code.scripts ?? []).map((src) => `<script type="text/javascript" src="${src}"></script>`).join('\n')}
+<!-- If we need an addon script, load p5 the usual way with no caching to make sure
46
+the import order doesn't get messed up. -->
47
+${((code.scripts?.length ?? 0) > 0 ? [cdnLibraryUrl, ...(code.scripts ?? [])] : []).map((src) => `<script type="text/javascript" src="${src}"></script>`).join('\n')}
48
<body>${code.htmlBody || ""}</body>
49
<script id="code" type="text/javascript">${wrapSketch(code.js) || ""}</script>
50
${(code.scripts?.length ?? 0) > 0 ? '' : `
0 commit comments