diff --git a/src/components/InteractiveCode.astro b/src/components/InteractiveCode.astro index 2ab92d1..0975b33 100644 --- a/src/components/InteractiveCode.astro +++ b/src/components/InteractiveCode.astro @@ -75,10 +75,10 @@ function trimAndDedent(input: string): Array { function highlightCode(lines: Array): string { let outLines: Array = []; - for (const line of lines) { + for (const [idx, line] of lines.entries()) { const tokens = lex(line); const lineArray = [ - "
" + `
` ]; for (const token of tokens) { @@ -99,16 +99,14 @@ function highlightCode(lines: Array): string { const codeHtml = highlightCode(trimAndDedent(code)); --- -
+
thp code
stdout
- aaaa -
- bbbb +
@@ -119,19 +117,36 @@ const codeHtml = highlightCode(trimAndDedent(code));
-