From 0f2bef0af7975d3e784d18cdaf2548c79e3591e3 Mon Sep 17 00:00:00 2001 From: krassowski <5832902+krassowski@users.noreply.github.com> Date: Thu, 15 Aug 2024 16:43:24 +0100 Subject: [PATCH] Code lines --- content/demo.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/demo.html b/content/demo.html index 923b63d..dcbf14b 100644 --- a/content/demo.html +++ b/content/demo.html @@ -101,14 +101,16 @@ break; } let cleanCode = ''; + let codeLines = ''; for (const line of code.split('\n')) { if (cleanCode === '' && line.length === 0) { continue } cleanCode += line.substring(indent) + '\n'; + codeLines += '&code=' + line.substring(indent); } codeEl.textContent = cleanCode; - iframe.src = `https://quansight.github.io/jupyterlite-demo/repl/index.html?kernel=python&toolbar=1&code=${cleanCode}`; + iframe.src = `https://quansight.github.io/jupyterlite-demo/repl/index.html?kernel=python&toolbar=1&${codeLines}`; iframe.style.width = '100%'; iframe.style.height = '300px'; iframe.onload = () => {