diff --git a/src/components/InteractiveCode.astro b/src/components/InteractiveCode.astro index d318ee8..2ab92d1 100644 --- a/src/components/InteractiveCode.astro +++ b/src/components/InteractiveCode.astro @@ -77,8 +77,10 @@ function highlightCode(lines: Array): string { for (const line of lines) { const tokens = lex(line); - const lineArray = []; - + const lineArray = [ + "
" + ]; + for (const token of tokens) { if (token.token_type !== "") { lineArray.push(`${token.v}`); @@ -86,6 +88,7 @@ function highlightCode(lines: Array): string { lineArray.push(token.v); } } + lineArray.push("
"); outLines.push(lineArray.join("")); } @@ -96,7 +99,7 @@ function highlightCode(lines: Array): string { const codeHtml = highlightCode(trimAndDedent(code)); --- -
+
thp code
@@ -115,4 +118,20 @@ const codeHtml = highlightCode(trimAndDedent(code));
+
+ +
+ + diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 9c14c7e..f16807e 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -35,5 +35,7 @@ const { title } = Astro.props; + + diff --git a/src/pages/learn/basics/hello-world.mdx b/src/pages/learn/basics/hello-world.mdx index 19a5fae..537a43e 100644 --- a/src/pages/learn/basics/hello-world.mdx +++ b/src/pages/learn/basics/hello-world.mdx @@ -38,5 +38,26 @@ f(x, y) f(x, y) `} - attr="aa" + steps={` + step { + line 1 + } + step { + line 1 + set x 322 + } + step { + line 2 + set y 322 + } + step { + line 8 + } + step { + line 4 + push f + set x 322 + set y 322 + } + `} >