From 88b7c6ef2df022e9ddff7cc6c62e987fd63fa7da Mon Sep 17 00:00:00 2001 From: leomcelroy Date: Thu, 19 Oct 2023 20:04:06 -0400 Subject: [PATCH] clear code when loading guide --- astro/src/components/Help.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/astro/src/components/Help.tsx b/astro/src/components/Help.tsx index a21bbb802..81e56fff5 100644 --- a/astro/src/components/Help.tsx +++ b/astro/src/components/Help.tsx @@ -1,7 +1,7 @@ import styles from './Help.module.css' import { useState, useEffect } from 'preact/hooks' import { marked } from 'marked' - +import { loadCodeFromString } from "../lib/loadCodeFromString.ts"; marked.setOptions({ highlight: function (code, language) { @@ -41,6 +41,8 @@ export default function Help({ if (workshop === null) return + loadCodeFromString(""); + const res = await fetch( `https://raw.githubusercontent.com/hackclub/blot/main/guides/${workshop}.md` )