Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions assets/js/imjoy-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@
if (config.type === 'window') {
cfg.defaults = {}
}

if (!config.lang) {
if(cfg.type.includes("python")){
config.lang = "python"
}
else if(cfg.type.includes("javascript")){
config.lang = "javascript"
}
else{
console.error('"lang" is not specified, please make sure decorate the code block with the name of the language.')
}
}
if (config.lang !== 'html')
src = `<config lang="json">\n${JSON.stringify(cfg, null, 1)}\n</config>\n<script lang="${config.lang}">\n${src}<\/script>`;
else
Expand Down Expand Up @@ -312,6 +322,7 @@
preElm.pluginConfig.id = id;

preElm.pluginConfig.namespace = id;
// for some reason, the data-lang attribute disappeared in the newer version
preElm.pluginConfig.lang = preElm.getAttribute('data-lang');

const outputFullscreenElm = preElm.querySelector(".fullscreen-button");
Expand Down Expand Up @@ -694,4 +705,4 @@
initializeRunButtons();
});

})();
})();