Skip to content

Commit 3b2094b

Browse files
committed
Fix no previewer for no-code demos
1 parent 66977e6 commit 3b2094b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/window.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,10 @@ export default function Window({ application, session }) {
339339

340340
const lang = langs[language.toLowerCase()];
341341
// Do nothing if there is no code to avoid compile errors
342+
// unless the language is JavaScript, because in this case
343+
// this is probably a demo without code.
342344
const text = lang.document.code_view.buffer.text.trim();
343-
if (text === "") {
345+
if (text === "" && language !== "JavaScript") {
344346
return;
345347
}
346348

0 commit comments

Comments
 (0)