Skip to content

Commit

Permalink
fix: await highlight result in code component
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Apr 1, 2024
1 parent dee7ab8 commit dc0a17a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/astro/components/Code.astro
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ const highlighter = await getCachedHighlighter({
wrap,
});
const html = highlighter.highlight(code, typeof lang === 'string' ? lang : lang.name, {
const html = await highlighter.highlight(code, typeof lang === 'string' ? lang : lang.name, {
inline,
attributes: rest as any,
});
debugger;
---

<Fragment set:html={html} />

0 comments on commit dc0a17a

Please sign in to comment.