Skip to content

Commit

Permalink
fix: empty code rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
DIYgod committed Jul 8, 2024
1 parent 708f436 commit 0d9fb87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/shiki/shiki.server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ export const ShikiRender: FC<ShikiCodeProps> = async ({
codeTheme,
language,
}) => {
if (!code) {
return null
}

const highlighter = await createHighlighter()

if (!Object.keys(bundledLanguages).includes(language || "")) {
Expand Down

0 comments on commit 0d9fb87

Please sign in to comment.