We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02f3f9f commit 452bbf3Copy full SHA for 452bbf3
1 file changed
src/components/Code.astro
@@ -20,16 +20,10 @@ const response = await fetch(
20
);
21
22
const parsed = await response.json();
23
-let version = parsed?.[0]?.["name"] ?? "v8.0.0";
+const version = parsed?.[0]?.["name"] ?? "v8.0.0";
24
25
const { code, lang, noVersion, ...props } = Astro.props;
26
-
27
-if (noVersion)
28
-{
29
- version = version.substring(1);
30
-}
31
32
-const versionedCode = code.replace("$VERSION$", version);
+const versionedCode = code.replace("$VERSION$", noVersion ? version.substring(1) : version);
33
---
34
35
<Default code={versionedCode} lang={lang} {...props}>
0 commit comments