Skip to content

Commit

Permalink
CodeBlock: Fix issues with stg lang codeblocks
Browse files Browse the repository at this point in the history
  • Loading branch information
MrTipson committed Jul 11, 2024
1 parent 676107a commit 03e94f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/components/CodeBlock.astro
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,13 @@ function highlightSTG(program: string) {
<div class="relative flex bg-muted/50">
{
isStgLang ? (
<pre>
<code set:html={highlightSTG(code)} />
</pre>
<pre class="codeBlock"><code set:html={highlightSTG(code)} /></pre>
) : (
<Code code={code} lang={lang || 'plaintext'} class="codeBlock" />
<Code
code={code}
lang={lang || "plaintext"}
class="codeBlock"
/>
)
}
<Button size={"icon"} variant={"outline"} className="copyCode">
Expand Down
3 changes: 2 additions & 1 deletion src/components/MdMachine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export function MdMachine({ children, program, step, garbage_collection, eval_ap
const settings: STGSettings = {
garbage_collection: garbage_collection,
eval_apply: eval_apply,
collapse_indirections: collapse_indirections
collapse_indirections: collapse_indirections,
run_limit: 1 // should not matter since machine isn't run
}
while (step > machine.step_number && machine.step());
const str = (children as React.ReactElement).props.value;
Expand Down

0 comments on commit 03e94f9

Please sign in to comment.