Skip to content

Commit

Permalink
Handle code fences with no language
Browse files Browse the repository at this point in the history
  • Loading branch information
yen223 committed Nov 5, 2024
1 parent 235640f commit 08e1440
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/lib/markdown/syntaxHighlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Highlight, themes } from "prism-react-renderer"

type FenceProps = {
children: string;
language: string;
language?: string;
};

export function Fence({ children, language }: FenceProps) {
return (
<Highlight code={children.trim()} language={language} theme={themes.vsDark}>
<Highlight code={children.trim()} language={language || ""} theme={themes.vsDark}>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
<pre style={style}>
{tokens.map((line, i) => (
Expand Down

0 comments on commit 08e1440

Please sign in to comment.