summaryrefslogtreecommitdiff
path: root/src/components/Markdown.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/Markdown.astro')
-rw-r--r--src/components/Markdown.astro11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/components/Markdown.astro b/src/components/Markdown.astro
index e8996c5..ce83e60 100644
--- a/src/components/Markdown.astro
+++ b/src/components/Markdown.astro
@@ -1,7 +1,7 @@
---
import { Marked } from 'marked';
import markedShiki from 'marked-shiki';
-import { getHighlighter } from 'shiki';
+import { highlighterPromise } from '../utils/highlighter';
interface Props {
content: string;
@@ -10,14 +10,7 @@ interface Props {
const { content, class: className } = Astro.props;
-// `getHighlighter` is async, it initializes the internal and
-// loads the languages and themes specified.
-// Then later you can use `highlighter.codeToHtml` synchronously
-// with the loaded themes and languages.
-const highlighter = await getHighlighter({
- langs: ['jsx', 'js'],
- themes: ['min-dark']
-});
+const highlighter = await highlighterPromise;
const html = await new Marked()
.use(
markedShiki({