From 145b36b6778c4d378581edb8333f22c86299bb2d Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Mon, 12 Aug 2024 00:05:02 +0800 Subject: [PATCH] ... --- web/index.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/web/index.html b/web/index.html index bfd806dd..fc127744 100644 --- a/web/index.html +++ b/web/index.html @@ -276,17 +276,16 @@ DEALINGS IN THE SOFTWARE. let code_output = document.querySelector('#code-output'); let run_button = document.querySelector('#run-button'); + code_editor.textContent = '# A recursive fibonacci function.\ndef fib(n):\n if n < 2:\n return n\n return fib(n-1) + fib(n-2)\n\n# Prints all fibonacci from 0 to 10 exclusive.\nfor i in range(10):\n print(f"fib({i}) = {fib(i)}")\n'; + let highlight = withLineNumbers(function (editor) { editor.textContent = editor.textContent; hljs.highlightElement(editor); }); highlight(code_editor); - CodeJar(code_editor, highlight); //, { indentOn: /[(\[{:]$/}); - code_editor.textContent = '# A recursive fibonacci function.\ndef fib(n):\n if n < 2:\n return n\n return fib(n-1) + fib(n-2)\n\n# Prints all fibonacci from 0 to 10 exclusive.\nfor i in range(10):\n print(f"fib({i}) = {fib(i)}")\n'; - window.onload = function () { run_button.onclick = function () { code_output.innerText = '';