Skip to content

Commit

Permalink
Use txt as a fallback language type
Browse files Browse the repository at this point in the history
  • Loading branch information
dguo committed Feb 23, 2024
1 parent 0ebc1d1 commit ab783d9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions components/SyntaxHighlighter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,14 @@ function SyntaxHighlighter(props) {
return null;
}

return match ? (
return (
<LightAsync
{...rest}
PreTag="div"
children={String(children).replace(/\n$/, "")}
language={match[1]}
language={match?.[1] ?? "txt"}
style={a11yDark}
/>
) : (
<code {...rest} className={className}>
{children}
</code>
);
}

Expand Down

0 comments on commit ab783d9

Please sign in to comment.